Re: [whatwg] HTTP status code from JavaScript

Wonderful, great input Karl, thanks! Very true about the sensitiveness
of the servers.

Yes, accessing the HTTP headers directly from DOM would be awesome
(without the need for an additional request!)

On 26/05/14 13:10, Karl Dubost wrote:
> Michael,
>
> A praise for more than HTTP status code.
>
> Le 23 mai 2014 à 12:36, Michael Heuberger <michael.heuberger@binarykitchen.com> a écrit :
>> There is a need to obtain the HTTP status code for the page itself from
>> JavaScript:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=999886
>
> We could do better. HTTP Code is yet another very specific bit of information.
> A question which is very often asked is how to access the HTTP headers from JavaScript without having to go through a round trip of XMLHttpRequest.
>
> http://stackoverflow.com/questions/220231/accessing-the-web-pages-http-headers-in-javascript
>
> I wish indeed that in the DOM there would be a way to access a JSON object with the full HTTP response headers and status line included.
>
> One of the reasons to record the full response instead of having to create an additional request is that some headers are time sensitive and some servers are very sensitive to the type of requests made. For example, some servers will (wrongly) send a different response for headers and/or status line if the HTTP request is made with a GET or a HEAD.
>
>
>
>

-- 

Binary Kitchen
Michael Heuberger
4c Dunbar Road
Mt Eden
Auckland 1024
(New Zealand)

Mobile (text only) ...  +64 21 261 89 81
Email ................  michael@binarykitchen.com
Website ..............  http://www.binarykitchen.com

Received on Monday, 26 May 2014 01:22:58 UTC