gleam/fetch

Types

pub type FetchBody
pub type FetchError {
  NetworkError(String)
  UnableToReadBody
  InvalidJsonBody
}

Constructors

  • NetworkError(String)
  • UnableToReadBody
  • InvalidJsonBody
pub type FetchRequest
pub type FetchResponse

Functions

pub fn bitarray_request_to_fetch_request(
  a: Request(BitArray),
) -> FetchRequest
pub fn from_fetch_response(
  a: FetchResponse,
) -> Response(FetchBody)
pub fn raw_send(
  a: FetchRequest,
) -> Promise(Result(FetchResponse, FetchError))
pub fn read_bytes_body(
  a: Response(FetchBody),
) -> Promise(Result(Response(BitArray), FetchError))
pub fn read_json_body(
  a: Response(FetchBody),
) -> Promise(Result(Response(Dynamic), FetchError))
pub fn read_text_body(
  a: Response(FetchBody),
) -> Promise(Result(Response(String), FetchError))
pub fn send(
  request: Request(String),
) -> Promise(Result(Response(FetchBody), FetchError))
pub fn send_bits(
  request: Request(BitArray),
) -> Promise(Result(Response(FetchBody), FetchError))
pub fn to_fetch_request(a: Request(String)) -> FetchRequest
Search Document