Y
yoram.ayalon
Hi,
I need to create a multipart request to UPS manifest upload electronic
service. UPS wants the request to consist of a series of headers and
bodies, and its not clear how can I use the HttpWebRequest object to do
this. there is the Headers collection, but I don't think it will give
me the control we need.
is there a low-level way to create the entire stream and attach to the
object before posting ?
this is the requirement for the request from UPS: notice it has the
first header, specifying Multipart and a boundry defined by the work
BOUNDRY.with a total length of 1040
then you have the first boundry, with length=140, the actual content
for this boundry, then another boundry ...
============================================
POST /hapld/tos/kdwhapltos HTTP/1.1<cr/lf>
Host: www.pld-certify.ups.com<cr/lf>
Content-type: multipart/mixed; boundary=BOUNDARY<cr/lf>
Content-length: 1040<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-www-form-urlencoded<cr/lf>
Content-length: 140<cr/lf>
<cr/lf>
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=
V4R1&UserId=useridvalue&Password=passwordvalue<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-ups-binary<cr/lf>
Content-length: 719<cr/lf>
<cr/lf>
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US
1234567002000001*BA1z1234560100002352 00001+0000000000000010 +000
0000000000000LBS01PRE10 3INUSD000001*CA18ATTENTION
DELIVERY 234 SOME LOCAL ST SO
ME CITY NJ 07652 US12015551212 *PA1z1234560100002352
02+0000010 +0000010
*SA000004<cr/lf>
<cr/lf>
--BOUNDARY--<cr/lf>
I need to create a multipart request to UPS manifest upload electronic
service. UPS wants the request to consist of a series of headers and
bodies, and its not clear how can I use the HttpWebRequest object to do
this. there is the Headers collection, but I don't think it will give
me the control we need.
is there a low-level way to create the entire stream and attach to the
object before posting ?
this is the requirement for the request from UPS: notice it has the
first header, specifying Multipart and a boundry defined by the work
BOUNDRY.with a total length of 1040
then you have the first boundry, with length=140, the actual content
for this boundry, then another boundry ...
============================================
POST /hapld/tos/kdwhapltos HTTP/1.1<cr/lf>
Host: www.pld-certify.ups.com<cr/lf>
Content-type: multipart/mixed; boundary=BOUNDARY<cr/lf>
Content-length: 1040<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-www-form-urlencoded<cr/lf>
Content-length: 140<cr/lf>
<cr/lf>
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=
V4R1&UserId=useridvalue&Password=passwordvalue<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-ups-binary<cr/lf>
Content-length: 719<cr/lf>
<cr/lf>
020082 2.0 2002101700000000000010500 000000001*AA0A1754 US
1234567002000001*BA1z1234560100002352 00001+0000000000000010 +000
0000000000000LBS01PRE10 3INUSD000001*CA18ATTENTION
DELIVERY 234 SOME LOCAL ST SO
ME CITY NJ 07652 US12015551212 *PA1z1234560100002352
02+0000010 +0000010
*SA000004<cr/lf>
<cr/lf>
--BOUNDARY--<cr/lf>