cURL / Mailing Lists / curl-users / Single Mail

curl-users

Multipart/Mixed HTTPS Request from Command Line

From: <Jan.Lacok_at_farrow.com>
Date: Wed, 17 Mar 2010 09:27:47 -0400

Hello

I'm relatively new to cURL and new to HTTP Request.

I need to create a HTTP Request in following format:

POST <POST URL HERE> HTTP/1.1<cr/lf>
Host: <CONNECT URL HERE><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=2.2&Accept123LicenseAgreement=Yes&ResponseType=application/x-123-456&VersionNumber=2222&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>
<UPLOAD DATA HERE - LOADED FROM FILE><cr/lf>
<cr/lf>
--BOUNDARY--<cr/lf>

The HTTP Header is fairly 'static' (except Content-length: 1040 and
Content-length: 719).

We are using Progress (database & language) to create a data file (<UPLOAD
DATA HERE - LOADED FROM FILE>), and I know the file size.
Since rest of the Header is static I will know the value for top most
'Content-length'.

I need to create HTTP Headers (from first Content-type) all the way to
last line (--BOUNDARY) - except the <UPLOAD DATA HERE - LOADED FROM FILE>
section
which is created by my application, using only cURL command line
parameters.

I have tried various combinations of startup parameters (-d, -F, -H) but I
can not 're-produce' the header as requested.

Is it possible to 'create' a header as required using only cURL command
line parameters?

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-17