A normalized description of an HTTP request.
You can queue a request using the up.request()
method:
let request = up.request('/foo')
console.log(request.url)
// A request object is also a promise for its response
let response = await request
console.log(response.text)
Aborts this request.
Whether this request is loading in the background.
The number of milliseconds after which this request can cause
an up:network:late
event.
The format in which the request params will be encoded.
The context of the layer targeted by this request.
The context of the layer targeted by this request in case the server responds with an error code.
The layer targeted by this request in case the server responds with an error code.
The mode of the layer targeted by this request in case the server responds with an error code.
The CSS selector targeted by this request in case the server responds with an error code.
Returns the fragment matched by this request's target selector.
Returns the fragments matched by this request's target selector.
The hash component of this request's URL.
Returns the HTTP request header value with the given name.
An object of HTTP headers that will be sent with this request.
The layer targeted by this request.
Loads this request object as a full-page request, replacing the entire browser environment with a new page from the server response.
Loads this request object as a full-page request, replacing the entire browser environment with a new page from the server response.
The HTTP method for the request.
The mode of the layer targeted by this request.
The element that triggered the request.
Parameters that should be sent as the request's payload.
The payload that the request will encode into its body.
Whether this request is preloading content.
The CSS selector targeted by this request.
An up.Request
is also a promise for the server response.
A timeout in milliseconds.
The requested URL.
Whether to wrap non-standard HTTP methods in a POST request.
Returns the underlying XMLHttpRequest
instance.