up.Response
JavaScript class
A response to an HTTP request.
Example
let response = await up.request('/foo')
console.log(response.status) // 200
console.log(response.text) // "<html><body>..."
Features
-
The number of milliseconds since this response was received.
-
The response's content-type.
-
Changes to the current context as set by the server.
-
The response's ETag.
-
Returns whether this cached response has expired.
-
Returns the HTTP header value with the given name.
-
Returns the HTTP header value with the given name.
-
Returns whether the response was not successful.
-
Returns whether the response has a content-type for HTML or XHTML.
-
Returns whether the server responded with a 2xx HTTP status.
-
The response body parsed from JSON.
-
The last modification time of the response's underlying content.
-
The HTTP method used for the request that produced this response.
-
Returns whether the server responded with a
2xxHTTP status. -
The response's HTTP status code as a
number. -
A render target pushed by the server.
-
The response body as a
string. -
A document title pushed by the server.
-
The URL from which the response was loaded.
-
The
XMLHttpRequestobject that was used to create this response.