How to set the Date header for an HTTP request

I want to set the header for the http request. Title Name - Date

http_request.setRequestHeader("Date", headers.date); 

But, when I see the request going to firebug. I do not see the Date request header.

How to install it?

+4
source share
1 answer

From XMLHttpRequest there is a set of headers that cannot be set. Take a look at the spec for setRequestHeader () . Date is one of these headers.

Also, if you look at the source code of WebKit , you can see this in the implementation.

 bool XMLHttpRequest::isAllowedHTTPHeader(const String& name) { initializeXMLHttpRequestStaticData(); return !staticData->m_forbiddenRequestHeaders.contains(name) && !name.startsWith(staticData->m_proxyHeaderPrefix, false) && !name.startsWith(staticData->m_secHeaderPrefix, false); } 
+4
source

All Articles