- From: Glenn Maynard <glenn@zewt.org>
- Date: Tue, 10 Apr 2012 17:58:20 -0500
- To: Jonas Sicking <jonas@sicking.cc>
- Cc: Anne van Kesteren <annevk@opera.com>, public-webapps@w3.org
Received on Tuesday, 10 April 2012 22:58:48 UTC
On Tue, Apr 10, 2012 at 5:50 PM, Jonas Sicking <jonas@sicking.cc> 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 is still valid text/plain data. If you want to omit Content-Type in the above case, then you should write: xhr.send(hasSomethingToSend() ? getTheThingToSend() : null); -- Glenn Maynard
Received on Tuesday, 10 April 2012 22:58:48 UTC