gluegun/response
gluegun/response
Section titled “gluegun/response”HTTP response values collected by gluegun/client.
A response contains the final status, headers, full body, trailers, and any
informational 1xx responses seen before the final response.
Informational
Section titled “Informational”Informational 1xx response represented by status and headers.
pub type Informational { Informational( status: Int, headers: List(#(String, String)) )}Response
Section titled “Response”Full HTTP response collected from a Gun stream.
Accessors: status, headers, body, body_text, trailers,
informational. The body is held fully in memory.
pub type ResponseFunctions
Section titled “Functions”Return the full collected response body.
pub fn body(Response) -> BitArraybody_text
Section titled “body_text”Decode the collected response body as UTF-8 text.
Returns DecodeError("Response body is not valid UTF-8") if the bytes
are not valid UTF-8. For binary responses use body directly.
pub fn body_text(Response) -> Result(String, error.GluegunError)headers
Section titled “headers”Return final response headers.
pub fn headers(Response) -> List(#(String, String))informational
Section titled “informational”Return informational 1xx responses received before the final response.
pub fn informational(Response) -> List(Informational)status
Section titled “status”Return the final response status.
pub fn status(Response) -> Inttrailers
Section titled “trailers”Return response trailers.
pub fn trailers(Response) -> List(#(String, String))