gossamer/request

Types

pub type Request

Values

pub fn array_buffer(
  request: Request,
) -> promise.Promise(Result(array_buffer.ArrayBuffer, String))
pub fn body(
  request: Request,
) -> Result(
  readable_stream.ReadableStream(uint8_array.Uint8Array),
  Nil,
)
pub fn bytes(
  request: Request,
) -> promise.Promise(Result(uint8_array.Uint8Array, String))
pub fn cache(request: Request) -> String

Returns the cache mode associated with request, which is a string indicating how the request will interact with the browser’s cache when fetching.

pub fn clone(request: Request) -> Request
pub fn credentials(request: Request) -> String

Returns the credentials mode associated with request, which is a string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL.

pub fn destination(request: Request) -> String

Returns the kind of resource requested by request, e.g., “document” or “script”.

pub fn headers(request: Request) -> headers.Headers

Returns a Headers object consisting of the headers associated with request.

pub fn integrity(request: Request) -> String

Returns request’s subresource integrity metadata.

pub fn is_body_used(request: Request) -> Bool
pub fn is_keepalive(request: Request) -> Bool

Returns a boolean indicating whether or not request can outlive the global in which it was created.

pub fn json(
  request: Request,
) -> promise.Promise(Result(dynamic.Dynamic, String))
pub fn method(request: Request) -> String

Returns request’s HTTP method, which is “GET” by default.

pub fn mode(request: Request) -> String

Returns the mode associated with request, which is a string indicating whether the request will use CORS, or will be restricted to same-origin URLs.

pub fn new(input: String) -> Result(Request, String)
pub fn new_with_init(
  input: String,
  init: List(request_init.RequestInit),
) -> Result(Request, String)
pub fn redirect(request: Request) -> String

Returns the redirect mode associated with request, which is a string indicating how redirects for the request will be handled during fetching.

pub fn referrer(request: Request) -> String

Returns the referrer of request.

pub fn referrer_policy(request: Request) -> String

Returns the referrer policy associated with request. This is used during fetching to compute the value of the request’s referrer.

pub fn signal(request: Request) -> abort_signal.AbortSignal

Returns the signal associated with request, which is an AbortSignal object indicating whether or not request has been aborted, and its abort event handler.

pub fn text(
  request: Request,
) -> promise.Promise(Result(String, String))
pub fn url(request: Request) -> String

Returns the URL of request as a string.

Search Document