The Request interface of the Fetch API represents a resource
The Request interface of the Fetch API represents a resource
(array-buffer this & args)
Method.
The arrayBuffer() method of the web.Body
mixin takes a web.Response
and reads it to completion. It returns a promise that resolves
an web.ArrayBuffer
.
response.arrayBuffer().then(function(buffer) { // do something with buffer });
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/arrayBuffer
Method. The arrayBuffer() method of the `web.Body` mixin takes a `web.Response` and reads it to completion. It returns a promise that resolves an `web.ArrayBuffer`. `response.arrayBuffer().then(function(buffer) { // do something with buffer });` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/arrayBuffer`
(blob this & args)
Method.
The blob() method of the web.Body
mixin takes a web.Response
and reads it to completion. It returns a promise that resolves
a web.Blob
.
response.blob().then(function(myBlob) { // do something with myBlob });
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/blob
Method. The blob() method of the `web.Body` mixin takes a `web.Response` and reads it to completion. It returns a promise that resolves a `web.Blob`. `response.blob().then(function(myBlob) { // do something with myBlob });` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/blob`
(body this)
Property.
The body read-only property of the web.Body
mixin is a simple
used to expose a web.ReadableStream
of the body contents.
var stream = responseInstance.body;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/body
Property. The body read-only property of the `web.Body` mixin is a simple used to expose a `web.ReadableStream` of the body contents. `var stream = responseInstance.body;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/body`
(body-used this)
Property.
The bodyUsed read-only property of the web.Body
mixin contains
web.Boolean
that indicates whether the body has been read yet.
var myBodyUsed = response.bodyUsed;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed
Property. The bodyUsed read-only property of the `web.Body` mixin contains `web.Boolean` that indicates whether the body has been read yet. `var myBodyUsed = response.bodyUsed;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed`
(cache this)
Property.
The cache read-only property of the web.Request
interface contains
cache mode of the request. It controls how the request will interact
the browser's HTTP cache.
var currentCacheMode = request.cache;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
Property. The cache read-only property of the `web.Request` interface contains cache mode of the request. It controls how the request will interact the browser's HTTP cache. `var currentCacheMode = request.cache;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/cache`
(clone this)
Method.
The clone() method of the web.Request
interface creates a copy
the current Request object.
var newRequest = request.clone();
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/clone
Method. The clone() method of the `web.Request` interface creates a copy the current Request object. `var newRequest = request.clone();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/clone`
Constructor.
The Request() constructor creates a new web.Request
object.
input Defines the resource that you wish to fetch. This can either be:
A web.USVString
containing the direct URL of the resource you want to fetch.
A web.Request
object, effectively creating a copy. Note the following behavioural updates to retain security while making the constructor less likely to throw exceptions:
If this object exists on another origin to the constructor call, the web.Request.referrer
is stripped out.
If this object has a web.Request.mode
of navigate, the mode value is converted to same-origin.
init Optional An options object containing any custom settings that you want to apply to the request. The possible options are:
method: The request method, e.g., GET, POST.
headers: Any headers you want to add to your request, contained within a web.Headers
object or an object literal with web.ByteString
values.
body: Any body that you want to add to your request: this can be a web.Blob
, web.BufferSource
, web.FormData
, web.URLSearchParams
, web.USVString
, or web.ReadableStream
object. Note that a request using the GET or HEAD method cannot have a body.
mode: The mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. The default is cors. In Chrome the default is no-cors before Chrome 47 and same-origin starting with Chrome 47.
credentials: The request credentials you want to use for the request: omit, same-origin, or include. The default is omit. In Chrome the default is same-origin before Chrome 47 and include starting with Chrome 47.
cache: The cache mode you want to use for the request.
redirect: The redirect mode to use: follow, error, or manual. In Chrome the default is follow (before Chrome 47 it defaulted to manual).
referrer: A web.USVString
specifying no-referrer, client, or a URL. The default is client.
integrity: Contains the subresource integrity value of the request (e.g., sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=).
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/Request
Constructor. The Request() constructor creates a new `web.Request` object. input Defines the resource that you wish to fetch. This can either be: A `web.USVString` containing the direct URL of the resource you want to fetch. A `web.Request` object, effectively creating a copy. Note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: If this object exists on another origin to the constructor call, the `web.Request.referrer` is stripped out. If this object has a `web.Request.mode` of navigate, the mode value is converted to same-origin. init Optional An options object containing any custom settings that you want to apply to the request. The possible options are: method: The request method, e.g., GET, POST. headers: Any headers you want to add to your request, contained within a `web.Headers` object or an object literal with `web.ByteString` values. body: Any body that you want to add to your request: this can be a `web.Blob`, `web.BufferSource`, `web.FormData`, `web.URLSearchParams`, `web.USVString`, or `web.ReadableStream` object. Note that a request using the GET or HEAD method cannot have a body. mode: The mode you want to use for the request, e.g., cors, no-cors, same-origin, or navigate. The default is cors. In Chrome the default is no-cors before Chrome 47 and same-origin starting with Chrome 47. credentials: The request credentials you want to use for the request: omit, same-origin, or include. The default is omit. In Chrome the default is same-origin before Chrome 47 and include starting with Chrome 47. cache: The cache mode you want to use for the request. redirect: The redirect mode to use: follow, error, or manual. In Chrome the default is follow (before Chrome 47 it defaulted to manual). referrer: A `web.USVString` specifying no-referrer, client, or a URL. The default is client. integrity: Contains the subresource integrity value of the request (e.g., sha256-BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=). See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/Request`
(context this)
Property.
The deprecated context read-only property of the web.Request
contains the context of the Request (e.g., audio, image, iframe).
var myContext = request.context;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/context
Property. The deprecated context read-only property of the `web.Request` contains the context of the Request (e.g., audio, image, iframe). `var myContext = request.context;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/context`
(credentials this)
Property.
The credentials read-only property of the web.Request
interface
whether the user agent should send cookies from the other domain
the case of cross-origin requests.
var myCred = request.credentials;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
Property. The credentials read-only property of the `web.Request` interface whether the user agent should send cookies from the other domain the case of cross-origin requests. `var myCred = request.credentials;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials`
(destination this)
Property.
The destination read-only property of the web.Request
interface
a string describing the type of content being requested.
var destination = request.destination;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/destination
Property. The destination read-only property of the `web.Request` interface a string describing the type of content being requested. `var destination = request.destination;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/destination`
(form-data this & args)
Method.
The formData() method of the web.Body
mixin takes a web.Response
and reads it to completion. It returns a promise that resolves
a web.FormData
object.
response.formData() .then(function(formdata) { // do something with your formdata });
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/formData
Method. The formData() method of the `web.Body` mixin takes a `web.Response` and reads it to completion. It returns a promise that resolves a `web.FormData` object. `response.formData() .then(function(formdata) { // do something with your formdata });` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/formData`
(headers this)
Property.
The headers read-only property of the web.Request
interface
the web.Headers
object associated with the request.
var myHeaders = request.headers;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/headers
Property. The headers read-only property of the `web.Request` interface the `web.Headers` object associated with the request. `var myHeaders = request.headers;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/headers`
(integrity this)
Property.
The integrity read-only property of the web.Request
interface
the subresource integrity value of the request.
var myIntegrity = request.integrity;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity
Property. The integrity read-only property of the `web.Request` interface the subresource integrity value of the request. `var myIntegrity = request.integrity;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity`
(json this & args)
Method.
The json() method of the web.Body
mixin takes a web.Response
and reads it to completion. It returns a promise that resolves
the result of parsing the body text as web.JSON
.
response.json().then(data => { // do something with your data });
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/json
Method. The json() method of the `web.Body` mixin takes a `web.Response` and reads it to completion. It returns a promise that resolves the result of parsing the body text as `web.JSON`. `response.json().then(data => { // do something with your data });` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/json`
(method this)
Property.
The method read-only property of the web.Request
interface
the request's method (GET, POST, etc.)
var myMethod = request.method;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/method
Property. The method read-only property of the `web.Request` interface the request's method (GET, POST, etc.) `var myMethod = request.method;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/method`
(mode this)
Property.
The mode read-only property of the web.Request
interface contains
mode of the request (e.g., cors, no-cors, same-origin, or navigate.)
is used to determine if cross-origin requests lead to valid responses,
which properties of the response are readable.
var myMode = request.mode;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
Property. The mode read-only property of the `web.Request` interface contains mode of the request (e.g., cors, no-cors, same-origin, or navigate.) is used to determine if cross-origin requests lead to valid responses, which properties of the response are readable. `var myMode = request.mode;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/mode`
(redirect this)
Property.
The redirect read-only property of the web.Request
interface
the mode for how redirects are handled.
var myRedirect = request.redirect;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect
Property. The redirect read-only property of the `web.Request` interface the mode for how redirects are handled. `var myRedirect = request.redirect;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect`
(referrer this)
Property.
The referrer read-only property of the web.Request
interface
set by the user agent to be the referrer of the Request. (e.g.,
no-referrer, or a URL.)
var myReferrer = request.referrer;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer
Property. The referrer read-only property of the `web.Request` interface set by the user agent to be the referrer of the Request. (e.g., no-referrer, or a URL.) `var myReferrer = request.referrer;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer`
(referrer-policy this)
Property.
The referrerPolicy read-only property of the web.Request
interface
the referrer policy, which governs what referrer information,
in the web.Referer
header, should be included with the request.
var myReferrerPolicy = request.referrerPolicy;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy
Property. The referrerPolicy read-only property of the `web.Request` interface the referrer policy, which governs what referrer information, in the `web.Referer` header, should be included with the request. `var myReferrerPolicy = request.referrerPolicy;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy`
(set-body! this val)
Property.
The body read-only property of the web.Body
mixin is a simple
used to expose a web.ReadableStream
of the body contents.
var stream = responseInstance.body;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/body
Property. The body read-only property of the `web.Body` mixin is a simple used to expose a `web.ReadableStream` of the body contents. `var stream = responseInstance.body;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/body`
(set-body-used! this val)
Property.
The bodyUsed read-only property of the web.Body
mixin contains
web.Boolean
that indicates whether the body has been read yet.
var myBodyUsed = response.bodyUsed;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed
Property. The bodyUsed read-only property of the `web.Body` mixin contains `web.Boolean` that indicates whether the body has been read yet. `var myBodyUsed = response.bodyUsed;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed`
(set-cache! this val)
Property.
The cache read-only property of the web.Request
interface contains
cache mode of the request. It controls how the request will interact
the browser's HTTP cache.
var currentCacheMode = request.cache;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/cache
Property. The cache read-only property of the `web.Request` interface contains cache mode of the request. It controls how the request will interact the browser's HTTP cache. `var currentCacheMode = request.cache;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/cache`
(set-context! this val)
Property.
The deprecated context read-only property of the web.Request
contains the context of the Request (e.g., audio, image, iframe).
var myContext = request.context;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/context
Property. The deprecated context read-only property of the `web.Request` contains the context of the Request (e.g., audio, image, iframe). `var myContext = request.context;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/context`
(set-credentials! this val)
Property.
The credentials read-only property of the web.Request
interface
whether the user agent should send cookies from the other domain
the case of cross-origin requests.
var myCred = request.credentials;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
Property. The credentials read-only property of the `web.Request` interface whether the user agent should send cookies from the other domain the case of cross-origin requests. `var myCred = request.credentials;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials`
(set-headers! this val)
Property.
The headers read-only property of the web.Request
interface
the web.Headers
object associated with the request.
var myHeaders = request.headers;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/headers
Property. The headers read-only property of the `web.Request` interface the `web.Headers` object associated with the request. `var myHeaders = request.headers;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/headers`
(set-integrity! this val)
Property.
The integrity read-only property of the web.Request
interface
the subresource integrity value of the request.
var myIntegrity = request.integrity;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity
Property. The integrity read-only property of the `web.Request` interface the subresource integrity value of the request. `var myIntegrity = request.integrity;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity`
(set-method! this val)
Property.
The method read-only property of the web.Request
interface
the request's method (GET, POST, etc.)
var myMethod = request.method;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/method
Property. The method read-only property of the `web.Request` interface the request's method (GET, POST, etc.) `var myMethod = request.method;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/method`
(set-mode! this val)
Property.
The mode read-only property of the web.Request
interface contains
mode of the request (e.g., cors, no-cors, same-origin, or navigate.)
is used to determine if cross-origin requests lead to valid responses,
which properties of the response are readable.
var myMode = request.mode;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode
Property. The mode read-only property of the `web.Request` interface contains mode of the request (e.g., cors, no-cors, same-origin, or navigate.) is used to determine if cross-origin requests lead to valid responses, which properties of the response are readable. `var myMode = request.mode;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/mode`
(set-redirect! this val)
Property.
The redirect read-only property of the web.Request
interface
the mode for how redirects are handled.
var myRedirect = request.redirect;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect
Property. The redirect read-only property of the `web.Request` interface the mode for how redirects are handled. `var myRedirect = request.redirect;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/redirect`
(set-referrer! this val)
Property.
The referrer read-only property of the web.Request
interface
set by the user agent to be the referrer of the Request. (e.g.,
no-referrer, or a URL.)
var myReferrer = request.referrer;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer
Property. The referrer read-only property of the `web.Request` interface set by the user agent to be the referrer of the Request. (e.g., no-referrer, or a URL.) `var myReferrer = request.referrer;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/referrer`
(set-referrer-policy! this val)
Property.
The referrerPolicy read-only property of the web.Request
interface
the referrer policy, which governs what referrer information,
in the web.Referer
header, should be included with the request.
var myReferrerPolicy = request.referrerPolicy;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy
Property. The referrerPolicy read-only property of the `web.Request` interface the referrer policy, which governs what referrer information, in the `web.Referer` header, should be included with the request. `var myReferrerPolicy = request.referrerPolicy;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/referrerPolicy`
(set-url! this val)
Property.
The url read-only property of the web.Request
interface contains
URL of the request.
var myURL = request.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/url
Property. The url read-only property of the `web.Request` interface contains URL of the request. `var myURL = request.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/url`
(text this & args)
Method.
The text() method of the web.Body
mixin takes a web.Response
and reads it to completion. It returns a promise that resolves
a web.USVString
object (text). The response is always decoded
UTF-8.
response.text().then(function (text) { // do something with the text response });
See also: https://developer.mozilla.org/en-US/docs/Web/API/Body/text
Method. The text() method of the `web.Body` mixin takes a `web.Response` and reads it to completion. It returns a promise that resolves a `web.USVString` object (text). The response is always decoded UTF-8. `response.text().then(function (text) { // do something with the text response });` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/text`
(url this)
Property.
The url read-only property of the web.Request
interface contains
URL of the request.
var myURL = request.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Request/url
Property. The url read-only property of the `web.Request` interface contains URL of the request. `var myURL = request.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/url`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close