gleam/httpc

Types

RequestBody

pub type RequestBody {
  StringBody(content_type: String, body: String)
  BitBody(content_type: String, body: BitString)
  NoBody
}

Constructors

  • StringBody(content_type: String, body: String)
  • BitBody(content_type: String, body: BitString)
  • NoBody

Response

pub type Response {
  Response(
    status: Int,
    headers: List(tuple(String, String)),
    body: String,
  )
}

Constructors

  • Response( status: Int, headers: List(tuple(String, String)), body: String, )

Functions

request

pub fn request(
  method method: Method,
  url url: String,
  headers headers: List(tuple(String, String)),
  body body: RequestBody,
) -> Result(Response, Dynamic)