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 11:35:43 -0400

Well I have tried 2 things:

1. I now understand the 'boundary' logic, so I left out of my command line
"boundary=BOUNDARY" and also left out the Content-length: for individual
sub-parts.
    But I'm still getting the feedback from server 'Missing AppVersion'.
    - also tried with just a 'AppVersion=1.0' in that DATA1.TXT file -
same result: 'Missing AppVersion'
    - also tried with url-encoding a 'AppVersion=1.0' as
'AppVersion=1%2E0' in that DATA1.TXT file - same result: 'Missing
AppVersion'

2.

> You can't set your own boundary string with curl. If you NEED that, you
must
> instead generate the entire thing yourself and send it with -d. It
should be
> very rare though.

This will be a preferred solution for us (to construct the entire thing
and send it with -d). I have tied to send the following:

Content-Type: multipart/mixed;
boundary=------------------------------814d8b8ab9f8
Content-length: 1036

------------------------------814d8b8ab9f8
Content-type: application/x-www-form-urlencoded
Content-length: 136

AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=userid&Password=password

------------------------------814d8b8ab9f8
Content-type: application/x-ups-binary
Content-length: 719

020093aaa-bbbb V2010.03
2010031000000006621400000085000000001

------------------------------814d8b8ab9f8--

cURL sent the following:

=> Send data, 560 bytes (0x230)
0000: Content-Type: multipart/mixed; boundary=------------------------
0040: ------814d8b8ab9f8Content-length: 1036--------------------------
0080: ----814d8b8ab9f8Content-type: application/x-www-form-urlencodedC
00c0: ontent-length: 136AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&R
0100: esponseType=application/x-ups-pld&VersionNumber=V4R1&UserId=user
0140: id&Password=password------------------------------814d8b8ab9f8Co
0180: ntent-type: application/x-ups-binaryContent-length: 719020093aaa
01c0: -bbbb V2010.03 201003100000000662140000008500000
0200: 0001------------------------------814d8b8ab9f8--
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK

Response from server was the following:

00c9: --BOUNDARY
00d5: Content-type: application/x-ups-psmpld
00fd: Content-length: 104
0112:
0114: UPSOnLine%null%6932%6823PLD Internal Processing Error Encountere
0154: d.
017a:
017c: --BOUNDARY
0188: Content-type: application/x-ups-pld
01ad: Content-length: 110
01c2:
01c4: 00010000009710000008800036823PLD Internal Processing Error Encou
0204: ntered.
0233:
0235: --BOUNDARY--

Questions:
- To construct it ourselves do we need to url-encode every line, every
string.
- I have tried with url-encoding CR/LF at the end of each line as %0D%0A
but it didn't work.
- What else we need to do to construct it properly.

3. Sorry for the disclaimers, but I can not do nothing about them.

I obviously don't know much about cURL, even less about posting HTTP
Request
formatted as requested. Thanks for your replies and patience.

Jan

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