W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

Re: XHR setting headers

From: Peter Michaux <petermichaux@gmail.com>
Date: Thu, 17 Apr 2008 20:03:28 -0700
Message-ID: <3cbaf1c80804172003o629dfaf3vee343f8e68d821f9@mail.gmail.com>
To: public-webapi@w3.org
Cc: "Julian Reschke" <julian.reschke@gmx.de>

On Thu, Apr 17, 2008 at 6:31 AM, Julian Reschke <julian.reschke@gmx.de> wrote:
> Peter Michaux wrote:


> > I think all XMLHttpRequest headers should be specified as blank when
> > the object is created. Then the JavaScript can add any headers it
> > needs to add. If, when the call to send() occurs, some essential
> > header(s) is missing the XHMLHttpRequest object should add these
> > automatically but only according to specified behavior.
> >
>  The whole "append" semantics is problematic as long as the user can't find
> out what the current value is.
>  IMHO we need either removeRequestHeader(), getRequestHeader(), or both.

These would certainly be nice additions in combination with having
blank headers after the XHR object's open() is called.

Without complete control over the headers there is no way to use the
HTTP protocol as it was intended. Hacks/workarounds must be employed.
In my situation, here I cannot control the Accept header,  I need to
either add a header like X-Accept or I need to use a parameter in the
URL like "/some/page.json" or "/some/page?format=json".

Received on Friday, 18 April 2008 03:12:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:10:01 UTC