lua-users home
lua-l archive

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

William Trenker wrote:
On 2/1/06, Keith Howe <> wrote:

On 2/1/06, William Trenker <> wrote:

However, if I add the additional header:
        ["Content-Type"] =  "application/x-www-form-urlencoded"
then I get the output "a = 1" indicating the server has now seen the POST body.

Any thoughts?

I'm not exactly sure what the issue is here, as this seems correct to
me. Without the content-type specified, the web server (and therefore
PHP script) has no way to interpret the data you are sending in the
POST body, and its safest option is to simply ignore it entirely. It
is perfectly legal HTTP to send data in a POST body that is not
x-www-form-urlencoded, so this header is required if you expect it to
be interpreted as form data in label=value pairs.

 That's what I thought, too.  Yet I can't get this to work without the
"Content-Type" header.

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? Has it worked this way on another CGI implementation? Do you have a browser which sends POST form data without including the proper content-type header?