getAllResponseHeaders
Summary
Returns all the response headers as a string, or null if no response has been received.
Method of apis/xhr/XMLHttpRequestapis/xhr/XMLHttpRequest
Syntax
var = object.getAllResponseHeaders();
Return Value
Returns an object of type StringString
Examples
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://localhost/test.xml", true);
xhr.send();
var headers = xhr.getAllResponseHeaders().toLowerCase();
alert(headers);
Notes
Each name/value pair in the returned string is delimited by a carriage return/line feed (CR/LF) sequence.
Related specifications
- W3C XMLHttpRequest Specification
- W3C Working Draft
Attributions
Microsoft Developer Network: Windows Internet Explorer API reference Article