gluegun/client
gluegun/client
Section titled “gluegun/client”High-level HTTP helpers for existing Gun connections.
These helpers collect regular HTTP/1.1 and HTTP/2 responses into
response.Response.
Informational 1xx responses are preserved and can be inspected with
response.informational.
Protocol messages for server push, upgrades, and WebSockets are rejected with
InvalidMessage; use the lower-level gluegun/message API for those flows.
Full response bodies are collected in memory; use the lower-level APIs for
streaming or very large responses.
Request
Section titled “Request”A collected HTTP request command.
Functions
Section titled “Functions”delete
Section titled “delete”Send DELETE on an open connection and collect the full response.
pub fn delete(gluegun/internal.Connection, String, List(#(String, String)), gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send GET on an open connection and collect the full response.
pub fn get(gluegun/internal.Connection, String, List(#(String, String)), gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send HEAD on an open connection and collect the full response.
pub fn head(gluegun/internal.Connection, String, List(#(String, String)), gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Construct a collected HTTP request command.
pub fn new(gluegun/request.Method, String) -> gluegun/client.Requestoptions
Section titled “options”Send OPTIONS on an open connection and collect the full response.
pub fn options(gluegun/internal.Connection, String, List(#(String, String)), gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send PATCH on an open connection and collect the full response.
pub fn patch(gluegun/internal.Connection, String, List(#(String, String)), BitArray, gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send POST on an open connection and collect the full response.
pub fn post(gluegun/internal.Connection, String, List(#(String, String)), BitArray, gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send PUT on an open connection and collect the full response.
pub fn put(gluegun/internal.Connection, String, List(#(String, String)), BitArray, gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)Send a collected HTTP request command on an open connection.
pub fn send(gluegun/client.Request, connection: gluegun/internal.Connection) -> Result(gluegun/response.Response, gluegun/error.GluegunError)send_raw
Section titled “send_raw”Send an HTTP request on an open connection and collect its full response.
pub fn send_raw(gluegun/internal.Connection, gluegun/request.Method, String, List(#(String, String)), BitArray, gluegun/request.RequestOptions, gluegun/connection.Timeout) -> Result(gluegun/response.Response, gluegun/error.GluegunError)with_body
Section titled “with_body”Replace the request body.
pub fn with_body(gluegun/client.Request, body: BitArray) -> gluegun/client.Requestwith_header
Section titled “with_header”Append a single request header.
pub fn with_header(gluegun/client.Request, name: String, value: String) -> gluegun/client.Requestwith_headers
Section titled “with_headers”Append request headers.
pub fn with_headers(gluegun/client.Request, headers: List(#(String, String))) -> gluegun/client.Requestwith_options
Section titled “with_options”Replace low-level request options.
pub fn with_options(gluegun/client.Request, options: gluegun/request.RequestOptions) -> gluegun/client.Requestwith_timeout
Section titled “with_timeout”Replace the request timeout.
pub fn with_timeout(gluegun/client.Request, timeout: gluegun/connection.Timeout) -> gluegun/client.Request