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
Functions
pub fn encode_headers(
headers: List(#(String, String)),
) -> BytesBuilder
pub fn read_request(
data: BitArray,
) -> Result(#(Request(Nil), BitArray), DecodePacketError)
pub fn read_response(
data: BitArray,
) -> Result(#(Response(Nil), BitArray), DecodePacketError)
pub fn response_builder(
status: Int,
headers: List(#(String, String)),
) -> BytesBuilder
pub fn status_to_bit_array(status: Int) -> BitArray
pub fn to_bytes_builder(
resp: Response(BytesBuilder),
) -> BytesBuilder
Turns an HTTP response into a TCP message