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.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`
(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`
(body this)
Property.
[Read Only] [Experimental]
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. [Read Only] [Experimental] 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`
(body-used this)
Property.
[Read Only]
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. [Read Only] 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`
(clone this)
Method.
The clone() method of the web.fetch.Response
interface creates
clone of a response object, identical in every way, but stored
a different 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.fetch.Response` interface creates clone of a response object, identical in every way, but stored a different variable. `var response2 = response1.clone();` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/clone`
(constructor & args)
Constructor.
The Response() constructor creates a new web.fetch.Response
object.
body Optional An object defining a body for the response. This can be null, or one of:
web.files.Blob
web.typed.BufferSource
web.FormData
web.files.ReadableStream
web.url.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.fetch.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.fetch.Response` object. body Optional An object defining a body for the response. This can be null, or one of: `web.files.Blob` `web.typed.BufferSource` `web.FormData` `web.files.ReadableStream` `web.url.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.fetch.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.fetch.Response
interface returns
new 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.fetch.Response` interface returns new 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.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`
(headers this)
Property.
[Read Only]
The headers read-only property of the web.fetch.Response
interface
the web.fetch.Headers
object associated with the response.
var myHeaders = response.headers;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/headers
Property. [Read Only] The headers read-only property of the `web.fetch.Response` interface the `web.fetch.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.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`
(ok this)
Property.
[Read Only]
The ok read-only property of the web.fetch.Response
interface
a Boolean stating whether the response was successful (status
the range 200-299) or not.
var myOK = response.ok;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/ok
Property. [Read Only] The ok read-only property of the `web.fetch.Response` interface a Boolean stating whether the response was successful (status the 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.fetch.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.fetch.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.
[Read Only]
The read-only redirected property of the web.fetch.Response
indicates whether or not the response is the result of a request
made which was redirected.
var isRedirected = Response.redirected;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected
Property. [Read Only] The read-only redirected property of the `web.fetch.Response` indicates whether or not the response is the result of a request made which was redirected. `var isRedirected = Response.redirected;` See also: `https://developer.mozilla.org/en-US/docs/Web/API/Response/redirected`
(set-use-final-url! this val)
Property.
[Obsolute]
The useFinalURL property of the web.fetch.Response
interface
a 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. [Obsolute] The useFinalURL property of the `web.fetch.Response` interface a 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.
[Read Only]
The status read-only property of the web.fetch.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. [Read Only] The status read-only property of the `web.fetch.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.
[Read Only]
The statusText read-only property of the web.fetch.Response
contains the status message corresponding to the status code
OK for 200).
var myStatusText = response.statusText;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/statusText
Property. [Read Only] The statusText read-only property of the `web.fetch.Response` contains the status message corresponding to the status code OK for 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.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`
(type this)
Property.
[Read Only]
The type read-only property of the web.fetch.Response
interface
the 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. [Read Only] The type read-only property of the `web.fetch.Response` interface the 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.
[Read Only]
The url read-only property of the web.fetch.Response
interface
the URL of the response. The value of the url property will be
final URL obtained after any redirects.
var myURL = response.url;
See also: https://developer.mozilla.org/en-US/docs/Web/API/Response/url
Property. [Read Only] The url read-only property of the `web.fetch.Response` interface the URL of the response. The value of the url property will be final 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.
[Obsolute]
The useFinalURL property of the web.fetch.Response
interface
a 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. [Obsolute] The useFinalURL property of the `web.fetch.Response` interface a 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