Liking cljdoc? Tell your friends :D

web.fetch.Request

The Request interface of the Fetch API represents a resource

The Request interface of the Fetch API represents a resource
raw docstring

array-buffercljs

(array-buffer this & args)

Method.

The arrayBuffer() method of the web.fetch.Body mixin takes web.fetch.Response stream and reads it to completion. It returns promise that resolves with an js.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.fetch.Body` mixin takes
`web.fetch.Response` stream and reads it to completion. It returns
promise that resolves with an `js.ArrayBuffer`.

`response.arrayBuffer().then(function(buffer) {
// do something with buffer
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/arrayBuffer`
sourceraw docstring

blobcljs

(blob this & args)

Method.

The blob() method of the web.fetch.Body mixin takes a web.fetch.Response and reads it to completion. It returns a promise that resolves a web.files.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.fetch.Body` mixin takes a `web.fetch.Response`
and reads it to completion. It returns a promise that resolves
a `web.files.Blob`.

`response.blob().then(function(myBlob) {
// do something with myBlob
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/blob`
sourceraw docstring

bodycljs

(body this)

Property.

The body read-only property of the web.fetch.Body mixin is simple getter used to expose a web.files.ReadableStream of 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.fetch.Body` mixin is
simple getter used to expose a `web.files.ReadableStream` of
body contents.

`var stream = responseInstance.body;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/body`
sourceraw docstring

body-usedcljs

(body-used this)

Property.

The bodyUsed read-only property of the web.fetch.Body mixin a js.Boolean that indicates whether the body has been read

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.fetch.Body` mixin
a `js.Boolean` that indicates whether the body has been read

`var myBodyUsed = response.bodyUsed;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed`
sourceraw docstring

cachecljs

(cache this)

Property.

The cache read-only property of the web.fetch.Request interface the cache mode of the request. It controls how the request will with 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.fetch.Request` interface
the cache mode of the request. It controls how the request will
with the browser's HTTP cache.

`var currentCacheMode = request.cache;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/cache`
sourceraw docstring

clonecljs

(clone this)

Method.

The clone() method of the web.fetch.Request interface creates copy of 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.fetch.Request` interface creates
copy of the current Request object.

`var newRequest = request.clone();`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/clone`
sourceraw docstring

constructorcljs

Constructor.

The Request() constructor creates a new web.fetch.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.fetch.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 Request.referrer is stripped out. If this object has a 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.fetch.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.files.Blob, web.typed.BufferSource, web.FormData, web.url.URLSearchParams, web.USVString, or web.files.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.fetch.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.fetch.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 `Request.referrer` is stripped out.
If this object has a `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.fetch.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.files.Blob`, `web.typed.BufferSource`, `web.FormData`, `web.url.URLSearchParams`, `web.USVString`, or `web.files.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`
sourceraw docstring

contextcljs

(context this)

Property.

The deprecated context read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

credentialscljs

(credentials this)

Property.

The credentials read-only property of the web.fetch.Request indicates whether the user agent should send cookies from the domain in 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.fetch.Request`
indicates whether the user agent should send cookies from the
domain in the case of cross-origin requests.

`var myCred = request.credentials;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials`
sourceraw docstring

destinationcljs

(destination this)

Property.

The destination read-only property of the web.fetch.Request returns 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.fetch.Request`
returns 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`
sourceraw docstring

form-datacljs

(form-data this & args)

Method.

The formData() method of the web.fetch.Body mixin takes a web.fetch.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.fetch.Body` mixin takes a `web.fetch.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`
sourceraw docstring

headerscljs

(headers this)

Property.

The headers read-only property of the web.fetch.Request interface the web.fetch.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.fetch.Request` interface
the `web.fetch.Headers` object associated with the request.

`var myHeaders = request.headers;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/headers`
sourceraw docstring

integritycljs

(integrity this)

Property.

The integrity read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

jsoncljs

(json this & args)

Method.

The json() method of the web.fetch.Body mixin takes a web.fetch.Response and reads it to completion. It returns a promise that resolves the result of parsing the body text as js.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.fetch.Body` mixin takes a `web.fetch.Response`
and reads it to completion. It returns a promise that resolves
the result of parsing the body text as `js.JSON`.

`response.json().then(data => {
// do something with your data
});`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/json`
sourceraw docstring

methodcljs

(method this)

Property.

The method read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

modecljs

(mode this)

Property.

The mode read-only property of the web.fetch.Request interface the mode of the request (e.g., cors, no-cors, same-origin, or This is used to determine if cross-origin requests lead to valid and 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.fetch.Request` interface
the mode of the request (e.g., cors, no-cors, same-origin, or
This is used to determine if cross-origin requests lead to valid
and which properties of the response are readable.

`var myMode = request.mode;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/mode`
sourceraw docstring

redirectcljs

(redirect this)

Property.

The redirect read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

referrercljs

(referrer this)

Property.

The referrer read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

referrer-policycljs

(referrer-policy this)

Property.

The referrerPolicy read-only property of the web.fetch.Request returns the referrer policy, which governs what referrer information, in the 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.fetch.Request`
returns the referrer policy, which governs what referrer information,
in the `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`
sourceraw docstring

set-body!cljs

(set-body! this val)

Property.

The body read-only property of the web.fetch.Body mixin is simple getter used to expose a web.files.ReadableStream of 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.fetch.Body` mixin is
simple getter used to expose a `web.files.ReadableStream` of
body contents.

`var stream = responseInstance.body;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/body`
sourceraw docstring

set-body-used!cljs

(set-body-used! this val)

Property.

The bodyUsed read-only property of the web.fetch.Body mixin a js.Boolean that indicates whether the body has been read

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.fetch.Body` mixin
a `js.Boolean` that indicates whether the body has been read

`var myBodyUsed = response.bodyUsed;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Body/bodyUsed`
sourceraw docstring

set-cache!cljs

(set-cache! this val)

Property.

The cache read-only property of the web.fetch.Request interface the cache mode of the request. It controls how the request will with 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.fetch.Request` interface
the cache mode of the request. It controls how the request will
with the browser's HTTP cache.

`var currentCacheMode = request.cache;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/cache`
sourceraw docstring

set-context!cljs

(set-context! this val)

Property.

The deprecated context read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

set-credentials!cljs

(set-credentials! this val)

Property.

The credentials read-only property of the web.fetch.Request indicates whether the user agent should send cookies from the domain in 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.fetch.Request`
indicates whether the user agent should send cookies from the
domain in the case of cross-origin requests.

`var myCred = request.credentials;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials`
sourceraw docstring

set-headers!cljs

(set-headers! this val)

Property.

The headers read-only property of the web.fetch.Request interface the web.fetch.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.fetch.Request` interface
the `web.fetch.Headers` object associated with the request.

`var myHeaders = request.headers;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/headers`
sourceraw docstring

set-integrity!cljs

(set-integrity! this val)

Property.

The integrity read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

set-method!cljs

(set-method! this val)

Property.

The method read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

set-mode!cljs

(set-mode! this val)

Property.

The mode read-only property of the web.fetch.Request interface the mode of the request (e.g., cors, no-cors, same-origin, or This is used to determine if cross-origin requests lead to valid and 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.fetch.Request` interface
the mode of the request (e.g., cors, no-cors, same-origin, or
This is used to determine if cross-origin requests lead to valid
and which properties of the response are readable.

`var myMode = request.mode;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/mode`
sourceraw docstring

set-redirect!cljs

(set-redirect! this val)

Property.

The redirect read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

set-referrer!cljs

(set-referrer! this val)

Property.

The referrer read-only property of the web.fetch.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.fetch.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`
sourceraw docstring

set-referrer-policy!cljs

(set-referrer-policy! this val)

Property.

The referrerPolicy read-only property of the web.fetch.Request returns the referrer policy, which governs what referrer information, in the 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.fetch.Request`
returns the referrer policy, which governs what referrer information,
in the `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`
sourceraw docstring

set-url!cljs

(set-url! this val)

Property.

The url read-only property of the web.fetch.Request interface the 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.fetch.Request` interface
the URL of the request.

`var myURL = request.url;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/url`
sourceraw docstring

textcljs

(text this & args)

Method.

The text() method of the web.fetch.Body mixin takes a web.fetch.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.fetch.Body` mixin takes a `web.fetch.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`
sourceraw docstring

urlcljs

(url this)

Property.

The url read-only property of the web.fetch.Request interface the 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.fetch.Request` interface
the URL of the request.

`var myURL = request.url;`

See also: `https://developer.mozilla.org/en-US/docs/Web/API/Request/url`
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close