cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with HTTP PUT

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 25 Sep 2001 08:01:40 +0200 (MET DST)

On Mon, 24 Sep 2001, Jon Travis wrote:

[This is a libcurl issue, I cc this reply to the libcurl list, please do that
too.]

> Having a problem with HTTP PUT's with libcurl 7.8.1. I'm setting the
> following values:
>
> curl_easy_setopt(transport->curl, CURLOPT_UPLOAD, 1);
> curl_easy_setopt(transport->curl, CURLOPT_PUT, 1);
> curl_easy_setopt(transport->curl, CURLOPT_INFILESIZE, put_len);
> curl_easy_setopt(transport->curl, CURLOPT_INFILE, helper);
> curl_easy_setopt(transport->curl, CURLOPT_READFUNCTION, stream_read);
>
> When I pull it into the proxy, all the headers are sent, and the correct
> Content-Length is sent, but the stream_read function is never called, and
> libcurl simply sits, waiting for data from the web server. Is this a
> known bug? It seems as though PUTs used to work.

Can you HTTP PUT with the command line tool?

I hacked up a quick HTTP PUT example code to try almost exactly your program
and my read callback was called properly. I tried it against my test perl
server so I also verified that the PUT data passed to the server looked good.

You mention a proxy there. Does that interfere with this somehow?

My HTTP PUT test code was just added to the docs/example directory and can be
viewed here:

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/curl/curl/docs/examples/httpput.c?rev=1.1&content-type=text/vnd.viewcvs-markup

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-25