Re: [XHR] XMLHttpRequest.send("")

2012-04-11 Thread Anne van Kesteren
On Wed, 11 Apr 2012 18:47:03 +0200, Boris Zbarsky wrote: On 4/11/12 3:01 AM, Anne van Kesteren wrote: How about send(optional (ArrayBuffer or Blob or Document or DOMString or FormData)? data = null) I think that should be fine too, yes. I don't have a strong preference for that over the o

Re: [XHR] XMLHttpRequest.send("")

2012-04-11 Thread Boris Zbarsky
On 4/11/12 3:01 AM, Anne van Kesteren wrote: How about send(optional (ArrayBuffer or Blob or Document or DOMString or FormData)? data = null) I think that should be fine too, yes. I don't have a strong preference for that over the overload version or vice versa. -Boris

Re: [XHR] XMLHttpRequest.send("")

2012-04-11 Thread Anne van Kesteren
On Wed, 11 Apr 2012 02:03:30 +0200, Boris Zbarsky wrote: On 4/10/12 7:15 PM, Jonas Sicking wrote: If I'm the only one who prefer the other behavior then we should stick to what the spec already says. I'll make sure Gecko maintains that behavior as we implement our new WebIDL bindings. One not

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jarred Nicholls
On Tue, Apr 10, 2012 at 9:00 PM, Jonas Sicking wrote: > On Tue, Apr 10, 2012 at 4:15 PM, Jonas Sicking wrote: > > On Tue, Apr 10, 2012 at 4:11 PM, Tab Atkins Jr. > wrote: > >> On Tue, Apr 10, 2012 at 3:58 PM, Glenn Maynard wrote: > >>> On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking > wrote: >

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jonas Sicking
On Tue, Apr 10, 2012 at 4:15 PM, Jonas Sicking wrote: > On Tue, Apr 10, 2012 at 4:11 PM, Tab Atkins Jr. wrote: >> On Tue, Apr 10, 2012 at 3:58 PM, Glenn Maynard wrote: >>> On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking wrote: Is it more surprising than that xhr.send(hasSomethingT

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Boris Zbarsky
On 4/10/12 7:15 PM, Jonas Sicking wrote: If I'm the only one who prefer the other behavior then we should stick to what the spec already says. I'll make sure Gecko maintains that behavior as we implement our new WebIDL bindings. One note, though. If we do want the current behavior, then I thin

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jonas Sicking
On Tue, Apr 10, 2012 at 4:11 PM, Tab Atkins Jr. wrote: > On Tue, Apr 10, 2012 at 3:58 PM, Glenn Maynard wrote: >> On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking wrote: >>> Is it more surprising than that >>> >>> xhr.send(hasSomethingToSend() ? getTheThingToSend() : ""); >>> >>> sets the Content-

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Tab Atkins Jr.
On Tue, Apr 10, 2012 at 3:58 PM, Glenn Maynard wrote: > On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking wrote: >> Is it more surprising than that >> >> xhr.send(hasSomethingToSend() ? getTheThingToSend() : ""); >> >> sets the Content-Type header even when no body is submitted? > > That's exactly w

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Glenn Maynard
On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking wrote: > Is it more surprising than that > > xhr.send(hasSomethingToSend() ? getTheThingToSend() : ""); > > sets the Content-Type header even when no body is submitted? > That's exactly what I would expect. A body that happens to have a zero length

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jonas Sicking
On Tue, Apr 10, 2012 at 3:42 PM, Jonas Sicking wrote: > On Tue, Apr 10, 2012 at 3:37 PM, Glenn Maynard wrote: >> On Tue, Apr 10, 2012 at 5:21 PM, Anne van Kesteren wrote: >>> >>> On Wed, 11 Apr 2012 00:08:47 +0200, Jonas Sicking >>> wrote: Is this intentional? This does matc

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jonas Sicking
On Tue, Apr 10, 2012 at 3:37 PM, Glenn Maynard wrote: > On Tue, Apr 10, 2012 at 5:21 PM, Anne van Kesteren wrote: >> >> On Wed, 11 Apr 2012 00:08:47 +0200, Jonas Sicking >> wrote: >>> >>> Is this intentional? >>> >>> This does match what Gecko does, but we are willing to change this if >>> other

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Glenn Maynard
On Tue, Apr 10, 2012 at 5:21 PM, Anne van Kesteren wrote: > On Wed, 11 Apr 2012 00:08:47 +0200, Jonas Sicking > wrote: > >> Is this intentional? >> >> This does match what Gecko does, but we are willing to change this if >> others agree that it's a better behavior. >> > > Yes, the idea is that y

Re: [XHR] XMLHttpRequest.send("")

2012-04-10 Thread Anne van Kesteren
On Wed, 11 Apr 2012 00:08:47 +0200, Jonas Sicking wrote: Is this intentional? This does match what Gecko does, but we are willing to change this if others agree that it's a better behavior. Yes, the idea is that you can transmit both the empty entity body and no entity body. The former will

[XHR] XMLHttpRequest.send("")

2012-04-10 Thread Jonas Sicking
Hi All, Our understanding of the current spec is that if someone calls the send function and pass "" as the body to be sent, this is almost equivalent to not passing a body at all. However, it still changes which Content-Type header is set. Consider the following code: xhr = new XMLHttpRequest; x