[mod_python] 411 Length Required for POST

Jim Gallacher jpg at jgassociates.ca
Fri Mar 3 15:17:56 EST 2006


Deron Meranda wrote:
> On 3/3/06, John Ruff <jcruff at gmail.com> wrote:
> 
>>     xmlHttp.open("POST", url, true);
>>     xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-
>>urlencoded')
>>     xmlHttp.setRequestHeader('Content-length', '0');
>>     xmlHttp.send(null);
> 
> 
> You're not sending any body!  Even if there's nothing to
> send, try sending '' rather than null.  I'm guessing that the
> XMLHttpRequest implementation is just not sending a
> Content-Length if you send null.

If you are not sending a body, just use GET. That way you don't need to 
worry about setting the content type or length. FieldStorage will still 
parse the url of a GET request to grab any parameters.

Jim





More information about the Mod_python mailing list