[comment] Allowing the modifications of HTTP Request headers

Hi,

When doing testing on Web pages, it is useful to be able to preset the HTTP request headers. The resource representation returned by the server will be different depending on these headers. It is happening for example in the case of an Accept-Language header (but not only).

 Accept-Language: en 
 Accept-Language: fr 

will return different contents with different properties. Some headers, some markup, style definitely (size of the text and then boxes), cookies, etc.

For example, same resource and two different representations one with the content in French the other with the content in English.

→ curl -sI -H "Accept-Language: fr" http://www.opera.com/

HTTP/1.1 200 OK
Date: Thu, 08 Nov 2012 12:27:17 GMT
Server: Apache
Content-Type: text/html; charset=utf-8
Set-Cookie: language=none; path=/; domain=www.opera.com; expires=Fri, 10-Aug-2012 12:27:17 GMT
Set-Cookie: language=fr; path=/; domain=.opera.com; expires=Sun, 06-Nov-2022 12:27:17 GMT
Vary: Accept-Encoding

→ curl -sI -H "Accept-Language: en" http://www.opera.com/

HTTP/1.1 200 OK
Date: Thu, 08 Nov 2012 12:27:27 GMT
Server: Apache
Content-Type: text/html; charset=utf-8
Set-Cookie: language=none; path=/; domain=www.opera.com; expires=Fri, 10-Aug-2012 12:27:27 GMT
Set-Cookie: language=en; path=/; domain=.opera.com; expires=Sun, 06-Nov-2022 12:27:27 GMT
Vary: Accept-Encoding


It would be good to allow to set those headers before the HTTP Request. 


PS: This comment is based on reading 
WebDriver
W3C Editor's Draft 08 November 2012
http://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html


-- 
Karl Dubost - http://dev.opera.com/
Developer Relations, Opera Software

Received on Thursday, 8 November 2012 12:30:11 UTC