cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Multipart/mixed from Config File

From: <Jan.Lacok_at_farrow.com>
Date: Fri, 19 Mar 2010 08:58:22 -0400

Let me try to explain it again... (sorry for the long message)

This is how the HTTP Request Message suppose to look like:

Content-type: multipart/mixed; boundary=BOUNDARY<cr/lf>
Content-length: 1036<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-www-form-urlencoded<cr/lf>
Content-length: 136<cr/lf>
<cr/lf>
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=password&Password=password<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-ups-binary<cr/lf>
Content-length: 719<cr/lf>
<cr/lf>
<MAIN PORTION OF THE DATA HERE><cr/lf>
<cr/lf>
--BOUNDARY--<cr/lf>

This is my cURL command line...

curl -H "User-Agent:" -H "Accept:" -H "Expect:" -H "Content-Type:
multipart/mixed; boundary=BOUNDARY" -F
"Filename=<C:\DATA1.TXT;type=application/x-www-form-urlencoded" -F
"Filename=<C:\DATA2.TXT;type=application/x-ups-binary" -o
"C:\curl-resp.txt" --trace-ascii "C:\curl-trace.txt" -k https://www.......

This is what is in the file DATA1.TXT:

Content-length: 136<cr/lf>
<cr/lf>
AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=userid&Password=password<cr/lf>

This is from cULR trace file:
...
0044: Content-Length: 1211
005a: Content-Type: multipart/mixed; boundary=BOUNDARY; boundary=-----
009a: -----------------------814d8b8ab9f8
00bf:
=> Send data, 144 bytes (0x90)
0000: ------------------------------814d8b8ab9f8
002c: Content-Disposition: form-data; name="Filename"
005d: Content-Type: application/x-www-form-urlencoded
008e:
=> Send data, 163 bytes (0xa3)
0000: Content-length: 136
0015:
0017: AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=applic
0057: ation/x-ups-pld&VersionNumber=V4R1&UserId=userid&Password=passwo
0097: rd
00a1:
=> Send data, 137 bytes (0x89)
0000:
0002: ------------------------------814d8b8ab9f8
002e: Content-Disposition: form-data; name="Filename"
005f: Content-Type: application/x-ups-binary
0087:
=> Send data, 719 bytes (0x2cf)
<DATA FROM FILE DATA2.TXT>
=> Send data, 48 bytes (0x30)
0000:
0002: ------------------------------814d8b8ab9f8--
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
...

This is response from the server:
...
00c9: --BOUNDARY
00d5: Content-type: application/x-ups-psmpld
00fd: Content-length: 104
0112:
0114: UPSOnLine%null%6931%6800AppVersion missing.
0154:
017a:
017c: --BOUNDARY
0188: Content-type: application/x-ups-pld
01ad: Content-length: 110
01c2:
01c4: 00010000009710000008800026800AppVersion missing.
0204:
0233:
0235: --BOUNDARY--
...

How the content of the file DATA1.TXT need to send in order for server to
see the AppVersion...?

This electronic message contains information from Russell A. Farrow
Limited, Russell A. Farrow (U.S.) Inc., canadaplus.com or RAF Express
Inc., that may be confidential or privileged. The information in this
electronic message is only for the use of the intended recipient.
Inappropriate disclosure, copying, distribution or other use of the
contents of this electronic message is strictly prohibited. If you have
received this electronic transmission in error, please notify the sender
immediately by return e-mail. Thank you.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-19