Darren Hoo <darren....@gmail.com> writes:

> (use-modules (web client))
>
> (http-post "http://www.google.com/";) 
>
> the POST request is sent without the Content-Length header

RFC 2616 makes it clear that the Content-Length header is optional.

> OK, let's add something to the body
>
> (http-post "http://www.google.com/"; #:body "")
>
> Howcome the request now becomes an http GET request:
>
> GET / HTTP/1.1
> Content-Type: text/plain;charset=utf-8
> Host: www.google.com
> Connection: close

I just applied a fix for this to the stable-2.0 branch in git.  In the
meantime, the workaround is to explicitly pass a content-type header
that specifies the charset, like this:

(http-post "http://www.google.com/";
           #:body ""
           #:headers '((content-type text/plain (charset . "utf-8"))))

> This is really ridiculous.

You found a bug.  It happens.  There's no need to be obnoxious about it.

      Mark

Reply via email to