W3C home > Mailing lists > Public > public-webapi@w3.org > August 2007

[XHR2] letting authors handle more response codes

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 06 Aug 2007 15:47:40 +0200
To: "Web API WG (public)" <public-webapi@w3.org>
Message-ID: <op.twm4lqz164w2qv@annevk-t60.oslo.opera.com>


I've heard some use cases from authors who want to handle more response  
codes. For 30x responses and 401 responses. 304 is already addressed by  
XHR1 by letting the author set various headers himself that will let the  
user agent pass through the actual response if it's a 304. However,  
redirects are always transparantly and a 401 will trigger a dialog where  
the user will have to enter credentials.

Letting the author handle redirects helps him save bandwidth or lets him  
inspect the redirect URI to see whether or not to follow it. Letting him  
handle 401 responses would help in the case where the user entered  
credentials in the first place and then a request was made using those  
credentials and they were entered incorrectly. In such cases handling it  
within your application might give a better user experience than letting  
the browser handle it.

For redirects a 'redirect' event is proposed in the draft, but maybe a  
general attribute that would indicate that the author wants to handle  
responses himself would be better. Although it seems that only 401 and  
redirects are affected by this so maybe a redirect and unauthorized event  
would work...

Any opinions?


Anne van Kesteren
Received on Monday, 6 August 2007 13:47:39 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:09:57 UTC