Weird problems with ‘curl -d’ and lighttpd

November 6, 2008 on 12:41 am | In Linux | 1 Comment

I’m trying to test a Google Checkout response handler for a project I’m working on. Rather than putting through sandbox orders I’m just trying to post a message using Curl but for some reason POSTing anything longer than about a kilobyte just doesn’t show up at the server, running lighttpd 1.4. Enabling some debugging showed that curl is sending an HTTP 100 header.

User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
Host: asap
Accept: */*
Content-Length: 1116
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue

There’s a bug in lighttpd 1.4 which means that this ‘Expect’ header is not handled properly. It won’t be fixed in v1.4 either.

The quick workaround for this bug is to call curl with the option “-H ‘Expect: ‘” to disable the header.

By the way, I also didn’t know how to post a file of data with curl – the answer is

curl -d ‘@file.xml’

1 Comment »

RSS feed for comments on this post. TrackBack URI

  1. Nice post. Thank you for the info. Keep it up.

    Comment by Tim Reynolds — December 7, 2008 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WordPress with theme based on Pool by Borja Fernandez.
Feeds: Entries and comments. Valid XHTML and CSS. ^Top^
Page required 29 queries and took 0.176 seconds.