Skip to content
Welcome to the Gluegun documentation!
Gluegun logo Gluegun logo

Gluegun

HTTP/1.1, HTTP/2, and WebSocket clients for Gleam on the BEAM.

Typed Gun Wrapper

Work with Gun connections, streams, responses, and WebSocket frames through Gleam types instead of raw Erlang messages.

HTTP/1.1 and HTTP/2

Prefer HTTP/2 when available while keeping HTTP/1.1 fallback behavior explicit in your connection options.

Streaming First

Use low-level request and message helpers for chunked request bodies, response chunks, trailers, cancellation, and flow control.

High-level Requests

Send one-shot requests on an existing connection and collect regular responses with the gluegun/client helpers.

WebSocket Support

Open, send, receive, and close WebSocket connections with a lifecycle-explicit API over HTTP/1.1.

Result-based Errors

Effectful operations return Result(_, GluegunError) so connection failures, timeouts, protocol mismatches, and decode errors stay visible.