W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 10 Apr 2012 15:50:19 -0700
Message-ID: <CA+c2ei-HLcX5w1r6SMk8bMhY8eBnpzQj1a=S7T0Cj8WDD6Go4g@mail.gmail.com>
To: Glenn Maynard <glenn@zewt.org>
Cc: Anne van Kesteren <annevk@opera.com>, public-webapps@w3.org
On Tue, Apr 10, 2012 at 3:42 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> On Tue, Apr 10, 2012 at 3:37 PM, Glenn Maynard <glenn@zewt.org> wrote:
>> On Tue, Apr 10, 2012 at 5:21 PM, Anne van Kesteren <annevk@opera.com> wrote:
>>>
>>> On Wed, 11 Apr 2012 00:08:47 +0200, Jonas Sicking <jonas@sicking.cc>
>>> 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 also have a Content-Length header set. Whether
>>> it is useful to have both...
>>
>> I'd find it very surprising if send(getSomeString()) resulted in a different
>> Content-Type depending on the length of the string.  A zero-length string is
>> still a string.
>
> Is it more surprising than that .send() and .send(hasSomethingToSend()
> ? getTheThingToSend() : "") sets a Content-Type even when no body is
> submitted?

Err.. sorry, that should say:

Is it more surprising than that

xhr.send(hasSomethingToSend() ? getTheThingToSend() : "");

sets the Content-Type header even when no body is submitted?

/ Jonas
Received on Tuesday, 10 April 2012 22:51:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:51 GMT