Welcome to the Gluegun documentation!
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.
Response
Section titled “Response”Full HTTP response collected from a Gun stream.
Type aliases
Section titled “Type aliases”Informational
Section titled “Informational”Informational 1xx response represented by status and headers.
pub type Informational = UnknownFunctions
Section titled “Functions”Return the full collected response body.
pub fn body(gluegun/response.Response) -> BitArraybody_text
Section titled “body_text”Decode a response body as UTF-8 text.
pub fn body_text(gluegun/response.Response) -> Result(String, gluegun/error.GluegunError)headers
Section titled “headers”Return final response headers.
pub fn headers(gluegun/response.Response) -> List(#(String, String))informational
Section titled “informational”Return informational 1xx responses received before the final response.
pub fn informational(gluegun/response.Response) -> List(#(Int, List(#(String, String))))Construct a response without informational responses.
pub fn new(status: Int, headers: List(#(String, String)), body: BitArray, trailers: List(#(String, String))) -> gluegun/response.Responsestatus
Section titled “status”Return the final response status.
pub fn status(gluegun/response.Response) -> Inttrailers
Section titled “trailers”Return response trailers.
pub fn trailers(gluegun/response.Response) -> List(#(String, String))with_body
Section titled “with_body”Return a response with a replaced body.
pub fn with_body(gluegun/response.Response, body: BitArray) -> gluegun/response.Responsewith_informational
Section titled “with_informational”Return a response with replaced informational responses.
pub fn with_informational(gluegun/response.Response, informational: List(#(Int, List(#(String, String))))) -> gluegun/response.Responsewith_trailers
Section titled “with_trailers”Return a response with replaced trailers.
pub fn with_trailers(gluegun/response.Response, trailers: List(#(String, String))) -> gluegun/response.Response