W3C home > Mailing lists > Public > public-webapi@w3.org > May 2006

Re: handling of POST in XMLHTTPRequest.

From: Mark Nottingham <mnot@yahoo-inc.com>
Date: Wed, 3 May 2006 13:56:22 -0700
Message-Id: <5E256012-9B6A-4A5D-9EBE-05B3BF66CE52@yahoo-inc.com>
Cc: <public-webapi@w3.org>
To: <David.Carson@nokia.com> <David.Carson@nokia.com>

RFC2616, Section 7.2.1;

>    Any HTTP/1.1 message containing an entity-body SHOULD include a
>    Content-Type header field defining the media type of that body. If
>    and only if the media type is not given by a Content-Type field,  
> the
>    recipient MAY attempt to guess the media type via inspection of its
>    content and/or the name extension(s) of the URI used to identify  
> the
>    resource. If the media type remains unknown, the recipient SHOULD
>    treat it as type "application/octet-stream".



On 2006/05/03, at 12:18 PM, <David.Carson@nokia.com>  
<David.Carson@nokia.com> wrote:

>
> Hi All,
> We have recently run into a case where XMLHTTPRequest is being used to
> POST content, but the javascript author has failed to add the  
> mandatory
> content-type header. We were wondering what the default content type
> should be. We believe that it should be the same default as the  
> default
> content type for a FORM post.
> Oddly enough, the w3 draft spec for xmlhttprequest does not even state
> that you should provide a content-type when posting:
> http://www.w3.org/TR/XMLHttpRequest/#dfn-send
> whereas XULPlanet at least states one should be provided:
> http://www.xulplanet.com/references/objref/ 
> XMLHttpRequest.html#method_se
> nd
> "The MIME type of the stream should be specified by setting the  
> Content-
> Type header via the setRequestHeader method before calling send."
> neither say what the default should be.
>
> Thanks
> David Carson
> Nokia S60 Browser
>
>
>
>

--
Mark Nottingham
mnot@yahoo-inc.com
Received on Wednesday, 3 May 2006 20:57:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:55 GMT