[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Luasocket 2.0: socket.http.request using POST
- From: William Trenker <wtrenker@...>
- Date: Tue, 7 Feb 2006 05:00:56 -0800
On 2/2/06, LEGO <email@example.com> wrote:
On 2/2/06, Mark Edgar <firstname.lastname@example.org> wrote:
> Why would you expect your server's CGI implementation to recognize the
> request body as application/x-www-form-urlencoded data in the absense of
> a content-type header which indicates this? Why do you expect it to
> work without the content-type header?
RFC 2616 (7.2.1 ) says that a given implementation SHOULD send a
Content-Type whenever there is a body, and that only if there is not
you MAY try to guess what's there.
Actually, I brought this subject up because the POST variant of the
simple, automatic form of
socket.http.request doesn't generate the Content-Type header. The
simple form includes a 2nd string argument which signifies a POST
request with the contents of the 2nd argument as the
body of the request. The code in socket/http.lua automatically
generates the necessary Content-Length header, but it doesn't generate
Content-Type header. I suspect from the feedback to my post that
code should be fixed. I wanted
to get some confirmation here before I posted a bug report.
Thanks for everyone's input.