XMLHttpRequest
XMLHttpRequest
(XHR) objects are used to interact with servers.
Properties
The XMLHttpRequest.readyState property returns the state an XMLHttpRequest client is in.
The read-only XMLHttpRequest property responseText
returns the text received from a server following a request being sent.
The XMLHttpRequest property responseType
is an enumerated string value specifying the type of data contained in the response.
The read-only XMLHttpRequest.responseURL
property returns the serialized URL of the response or the empty string if the URL is null
.
The XMLHttpRequest.responseXML
read-only property returns a Document containing the HTML or XML retrieved by the request; or null
if the request was unsuccessful, has not yet been sent, or if the data can't be parsed as XML or HTML.
The read-only XMLHttpRequest.statusText
property returns a string containing the response's status message as returned by the HTTP server.
The XMLHttpRequest upload
property returns an XMLHttpRequestUpload object that can be observed to monitor an upload's progress.
The XMLHttpRequest.withCredentials
property is a boolean value that indicates whether or not cross-site Access-Control
requests should be made using credentials such as cookies, authentication headers or TLS client certificates.
Functions
The XMLHttpRequest method getAllResponseHeaders()
returns all the response headers, separated by CRLF, as a string, or returns null
if no response has been received.
The XMLHttpRequest method getResponseHeader()
returns the string containing the text of a particular header's value.
The XMLHttpRequest method overrideMimeType()
specifies a MIME type other than the one provided by the server to be used instead when interpreting the data being transferred in a request.
The XMLHttpRequest method setRequestHeader()
sets the value of an HTTP request header.