cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Multipart/mixed from Config File

From: <Jan.Lacok_at_farrow.com>
Date: Thu, 18 Mar 2010 14:23:34 -0400

>> Is it possible to create a custom cURL config file, for SSLv3 HTTP
Request
>> with headers with various 'Content-type', 'boundary' between them and
>> '--data' loaded within places (2 different 'Content-type'-s).

> Multipart formposts are made with -F, and no it's not possible to set
your own
> boundary string.

Thanks Daniel for your reply.
I had some success with 'boundary' and multiple use of -F parameters
but...
My header for (SSL) HTTP Request need to looks like this:

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=user&Password=password<cr/lf>
<cr/lf>
--BOUNDARY<cr/lf>
Content-type: application/x-ups-binary<cr/lf>
Content-length: 719<cr/lf>
<cr/lf>
<data I'm uploading in here><cr/lf>
<cr/lf>
--BOUNDARY--<cr/lf>
.....

and my command like looks like this:

curl -H "User-Agent:" -H "Accept:" -H "Expect:" -H "Content-Type:
multipart/mixed; boundary=BOUNDARY" -F
"Filename=<C:\RAF\Curl\curl-7.20.0\RAF2.txt;type=application/x-www-form-urlencoded"
-F "Filename=<C:\Temp\0066214000.TXT;type=application/x-ups-binary" -k
https://...

I am loading the following lines from the file "RAF2.txt":

Content-length: 136

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

but I'm getting a response from server 'Missing application version'.
What am I doing wrong?
How can that be done with Multipart formposts using -F parameter(s)?
(I'm relatively new to cURL - command line only, PHP is not an option, OS
= IBM AIX - Application = Progress)

Thanks
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-18