cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Delay in HTTP PUT and a SOLUTION

From: <rodney_at_optimail.com.au>
Date: Thu, 25 Sep 2008 10:53:44 +1000 (EST)

> On Wed, Sep 17, 2008 at 03:19:38PM +1000, rodney_at_optimail.com.au wrote:
>> and for PUT:
>>
>> curl -v -H 'Content-Type: application/xml; charset=utf-8' -T tst.xml
>> http://127.0.0.1:8000/xml/book/3
>>
>> Analysis of the messages using tshark showed that curl was splitting up
>> the message sent, with 1 second delay on the curl side. The second part
>> of
>> the message was the file contents, 289 bytes in this case. Trace is
>> appended.
>
> What happens is that curl sends an Expect: 100-continue header in some
> cases, like all PUTs, and waits one second for a 100 Continue response.
> On a high latency link or a HTTP 1.0 server, this won't come in time and
> curl will just send the data eventually anyway. The right way to stop
> this behaviour is to override the continue wait with
> -H Expect: or -0
>
>>>> Dan

Thanks Dan,
 that's a better solution.

 Also I'm going to have a look in Django to see why it didn't respond with
a 100 Continue message. I don't recall seeing this with Ruby on Rails.

PS: the reason this issue is getting more attention is the prevalence of
REST type web services, in which the PUT operation is routinely used.

Rodney

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-09-25