The Response interface of the Fetch API represents the response a request.
The Response interface of the Fetch API represents the response a request.
(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`
(clone this)
Method.
The clone() method of the web.Response
interface creates a
of a response object, identical in every way, but stored in a
variable.
var response2 = response1.clone();
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/clone
Method. The clone() method of the `web.Response` interface creates a of a response object, identical in every way, but stored in a variable. `var response2 = response1.clone();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/clone`
Constructor.
The Response() constructor creates a new web.Response
object.
body Optional An object defining a body for the response. This can be null, or one of:
web.Blob
web.BufferSource
web.FormData
web.ReadableStream
web.URLSearchParams
web.USVString
init Optional An options object containing any custom settings that you want to apply to the response. The possible options are:
status: The status code for the reponse, e.g., 200.
statusText: The status message associated with the status code, e.g., OK.
headers: Any headers you want to add to your response, contained within a web.Headers
object or object literal of web.ByteString
key/value pairs (see HTTP headers for a reference).
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/Response
Constructor. The Response() constructor creates a new `web.Response` object. body Optional An object defining a body for the response. This can be null, or one of: `web.Blob` `web.BufferSource` `web.FormData` `web.ReadableStream` `web.URLSearchParams` `web.USVString` init Optional An options object containing any custom settings that you want to apply to the response. The possible options are: status: The status code for the reponse, e.g., 200. statusText: The status message associated with the status code, e.g., OK. headers: Any headers you want to add to your response, contained within a `web.Headers` object or object literal of `web.ByteString` key/value pairs (see HTTP headers for a reference). See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/Response`
(error this)
Method.
The error() method of the web.Response
interface returns a
Response object associated with a network error.
var errorResponse = Response.error();
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/error
Method. The error() method of the `web.Response` interface returns a Response object associated with a network error. `var errorResponse = Response.error();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/error`
(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.Response
interface
the web.Headers
object associated with the response.
var myHeaders = response.headers;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/headers
Property. The headers read-only property of the `web.Response` interface the `web.Headers` object associated with the response. `var myHeaders = response.headers;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/headers`
(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`
(ok this)
Property.
The ok read-only property of the web.Response
interface contains
Boolean stating whether the response was successful (status in
range 200-299) or not.
var myOK = response.ok;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/ok
Property. The ok read-only property of the `web.Response` interface contains Boolean stating whether the response was successful (status in range 200-299) or not. `var myOK = response.ok;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/ok`
(redirect this url status)
Method.
The redirect() method of the web.Response
interface returns
Response resulting in a redirect to the specified URL.
var response = Response.redirect(url, status);
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect
Method. The redirect() method of the `web.Response` interface returns Response resulting in a redirect to the specified URL. `var response = Response.redirect(url, status);` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/redirect`
(redirected this)
Property.
The read-only redirected property of the web.Response
interface
whether or not the response is the result of a request you made
was redirected.
var isRedirected = Response.redirected;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected
Property. The read-only redirected property of the `web.Response` interface whether or not the response is the result of a request you made was redirected. `var isRedirected = Response.redirected;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected`
(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-headers! this val)
Property.
The headers read-only property of the web.Response
interface
the web.Headers
object associated with the response.
var myHeaders = response.headers;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/headers
Property. The headers read-only property of the `web.Response` interface the `web.Headers` object associated with the response. `var myHeaders = response.headers;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/headers`
(set-ok! this val)
Property.
The ok read-only property of the web.Response
interface contains
Boolean stating whether the response was successful (status in
range 200-299) or not.
var myOK = response.ok;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/ok
Property. The ok read-only property of the `web.Response` interface contains Boolean stating whether the response was successful (status in range 200-299) or not. `var myOK = response.ok;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/ok`
(set-status! this val)
Property.
The status read-only property of the web.Response
interface
the status code of the response (e.g., 200 for a success).
var myStatus = response.status;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/status
Property. The status read-only property of the `web.Response` interface the status code of the response (e.g., 200 for a success). `var myStatus = response.status;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/status`
(set-status-text! this val)
Property.
The statusText read-only property of the web.Response
interface
the status message corresponding to the status code (e.g., OK
200).
var myStatusText = response.statusText;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText
Property. The statusText read-only property of the `web.Response` interface the status message corresponding to the status code (e.g., OK 200). `var myStatusText = response.statusText;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText`
(set-type! this val)
Property.
The type read-only property of the web.Response
interface contains
type of the response. It can be one of the following:
var myType = response.type;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/type
Property. The type read-only property of the `web.Response` interface contains type of the response. It can be one of the following: `var myType = response.type;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/type`
(set-url! this val)
Property.
The url read-only property of the web.Response
interface contains
URL of the response. The value of the url property will be the
URL obtained after any redirects.
var myURL = response.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/url
Property. The url read-only property of the `web.Response` interface contains URL of the response. The value of the url property will be the URL obtained after any redirects. `var myURL = response.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/url`
(set-use-final-url! this val)
Property.
The useFinalURL property of the web.Response
interface contains
boolean stating whether this is the final URL of the response.
var isfinalURL = Response.useFinalURL;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/useFinalURL
Property. The useFinalURL property of the `web.Response` interface contains boolean stating whether this is the final URL of the response. `var isfinalURL = Response.useFinalURL;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/useFinalURL`
(status this)
Property.
The status read-only property of the web.Response
interface
the status code of the response (e.g., 200 for a success).
var myStatus = response.status;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/status
Property. The status read-only property of the `web.Response` interface the status code of the response (e.g., 200 for a success). `var myStatus = response.status;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/status`
(status-text this)
Property.
The statusText read-only property of the web.Response
interface
the status message corresponding to the status code (e.g., OK
200).
var myStatusText = response.statusText;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText
Property. The statusText read-only property of the `web.Response` interface the status message corresponding to the status code (e.g., OK 200). `var myStatusText = response.statusText;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText`
(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`
(type this)
Property.
The type read-only property of the web.Response
interface contains
type of the response. It can be one of the following:
var myType = response.type;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/type
Property. The type read-only property of the `web.Response` interface contains type of the response. It can be one of the following: `var myType = response.type;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/type`
(url this)
Property.
The url read-only property of the web.Response
interface contains
URL of the response. The value of the url property will be the
URL obtained after any redirects.
var myURL = response.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/url
Property. The url read-only property of the `web.Response` interface contains URL of the response. The value of the url property will be the URL obtained after any redirects. `var myURL = response.url;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/url`
(use-final-url this)
Property.
The useFinalURL property of the web.Response
interface contains
boolean stating whether this is the final URL of the response.
var isfinalURL = Response.useFinalURL;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/useFinalURL
Property. The useFinalURL property of the `web.Response` interface contains boolean stating whether this is the final URL of the response. `var isfinalURL = Response.useFinalURL;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/useFinalURL`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close