Re: [XHR] send doesn’t explain what to do w hen method is GET

Jonas Sicking <jonas@sicking.cc> wrote:

> 
> Anne van Kesteren wrote:
> > 
> > On Mon, 10 Dec 2007 15:47:37 +0100, Maciej Stachowiak <mjs@apple.com> 
> > wrote:
> >> 3) The spec as written doesn't "state nothing", it appears to clearly 
> >> require sending an entity body and does not allow ignoring the body or 
> >> throwing an exception regardless of what is allowed per RFC. So some 
> >> change is needed, one way or another.
> > 
> > Ok. How about we add a step 5 of the send() algorithm that states that 
> > additional requirements in RFC 2616 are also to be taken into account. 
> > That should effectively defer the issue to RFC 2616.
> 
> Does any currently released browse include the body when doing an XHR 
> GET request? If a big majority of them currently drop the body, then it 
> seems like it would help interoperability if the spec explicitly stated 
> that the body should be dropped.
> 
> IMHO this wouldn't be going against RFC 2616 as it's the application, 
> not the network layer, that drops the body.

Under no circumstances will my code permit an entity body to be sent as part
of a request for an object that is going to be requested via GET or HEAD.
It's just asking for trouble.  It also will not permit related headers to be
set (Content-Length, Transfer-Encoding et al will be dropped)

I never understood what I should do when an XMLHttpRequest object is
presented with data to send and the method was GET or HEAD.  Currently, I
convert the data to a UTF-8 string and store it as the query field of the
URI, as that seemed the most useful thing to do (particularly the the data
attribute was a string or something that was easily stringified).

I did briefly also consider automatically converting the method to POST, but
decided that that was simply dangerous.


-- 
Stewart Brodie
Software Engineer
ANT Software Limited

Received on Friday, 14 December 2007 18:19:26 UTC