[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is (web client) ready for use even for the simplest task?
From: |
Mark H Weaver |
Subject: |
Re: is (web client) ready for use even for the simplest task? |
Date: |
Tue, 10 Sep 2013 05:19:00 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Darren Hoo <address@hidden> 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