cURL / Mailing Lists / curl-users / Single Mail

curl-users

not able to make a multipart request on windows

From: David Graf <david.graf_at_28msec.com>
Date: Mon, 11 Oct 2010 14:35:41 +0200

Hello

I am trying to do a multipart request on Windows with the same code I am able to do one on Linux. Unfortunately, the request sent to the server looks different than the one sent on Linux (I appended them to the email). The problem is the Content-Type header of the request. If I set the Content-Type header on windows (with curl_easy_setopt(..., CURLOPT_HTTPHEADER,...)), it doesn't overwrite the default Content-Type. Somehow, it just adds my content type to the request but keeps the default one. Therefore, the request is not interpreted correctly by the server.

Do you have an idea what I am doing wrong?

Regards,
David

Request Windows:

POST /rest-tests/request.php HTTP/1.1
User-Agent: libcurl-agent/1.0
Host: www.zorba-xquery.com
Pragma: no-cache
Accept: */*
foo: bar
Content-Type: multipart/mixed
Content-Length: 503
Expect: 100-continue

Content-Type: multipart/form-data; boundary=----------------------------088c39a1c7e6
------------------------------088c39a1c7e6
Content-Disposition: form-data; name="blubb"
insidemutlipart:blubb
Content-Type: text/plain

        A small text test
      
------------------------------088c39a1c7e6
Content-Disposition: form-data; name="blubb"
Content-Type: text/plain

        Another small text body
      
------------------------------088c39a1c7e6
Content-Disposition: form-data; name="

Request Linux:

POST /rest-tests/request.php HTTP/1.1
User-Agent: libcurl-agent/1.0
Host: www.zorba-xquery.com
Accept: */*
foo: bar
Content-Length: 503
Expect: 100-continue
Content-Type: multipart/mixed; boundary=----------------------------39ab57b6f2de

------------------------------39ab57b6f2de
Content-Disposition: form-data; name="blubb"
insidemutlipart:blubb
Content-Type: text/plain

        A small text test
      
------------------------------39ab57b6f2de
Content-Disposition: form-data; name="blubb"
Content-Type: text/plain

        Another small text body
      
------------------------------39ab57b6f2de
Content-Disposition: form-data; name="blubb"
Content-Type: img/png

lqenw
------------------------------39ab57b6f2de--

-------------------------------------------------------------------
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-10-11