cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTP Put and Content-Length header

From: Alex Bligh <alex_at_alex.org.uk>
Date: Tue, 09 Aug 2011 13:31:06 +0100

I am doing an HTTP PUT with a binary file to a server which requires
a non-zero Content-Length to be set.

I have tried setting CURLOPT_INFILESIZE_LARGE to the length of the the file.
I have tried setting CURLOUT_IGNORE_CONTENT_LENGTH to 0
I have tried manually adding a Content-Length: header.
I have tried various combinations of the above.

I can make this work with
 curl -X PUT -T [file] -D - [url]

Adding --libcurl put.c suggests that what curl is doing is providing
it's own function to supply the headers (perhaps I am reading this wrong).

The behaviour I expected was for curl to work the content length out
from CURLOPT_INFILESIZE_LARGE. Perhaps that was naive?

What am I doing wrong here?

-- 
Alex Bligh
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-08-09