Retrieving the Response

A complete HTTP response consists of a status code, a set of
response headers, and a response body. These are available
through properties and methods of the XMLHttpRequest
object:
• The status and statusText properties return the HTTP
status in numeric and textual forms. These properties hold
standard HTTP values like 200 and “OK” for successful
requests, and 404 and “Not Found” for URLs that don’t
match any resource on the server.
• The response headers can be queried with getResponse
Header() and getAllResponseHeaders().
• The response body is available in textual form from the
responseText property.
The XMLHttpRequest object is used asynchronously: the
send() method returns immediately after sending the request,
and the response methods and properties listed above aren’t
valid until the response is received.