gramps/http

Types

pub type DecodePacketError {
  More(length: Int)
  HttpError(reason: String)
}

Constructors

  • More(length: Int)
  • HttpError(reason: String)
pub type PacketType {
  HttphBin
  HttpBin
}

Constructors

  • HttphBin
  • HttpBin

Values

pub fn encode_headers(
  headers: List(#(String, String)),
) -> bytes_tree.BytesTree
pub fn read_request(
  data: BitArray,
) -> Result(#(request.Request(Nil), BitArray), DecodePacketError)
pub fn read_response(
  data: BitArray,
) -> Result(
  #(response.Response(Nil), BitArray),
  DecodePacketError,
)
pub fn response_builder(
  status: Int,
  headers: List(#(String, String)),
) -> bytes_tree.BytesTree
pub fn status_to_bit_array(status: Int) -> BitArray
pub fn to_bytes_tree(
  resp: response.Response(bytes_tree.BytesTree),
) -> bytes_tree.BytesTree

Turns an HTTP response into a TCP message

Search Document