lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 2/2/06, LEGO <> wrote:
On 2/2/06, Mark Edgar <> 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 a Content-Type header.  I suspect from the feedback to my post that the code should be fixed. I wanted to get some confirmation here before I posted a bug report. 

Thanks for everyone's input.