HTTP.jl
HTTP.jl is an HTTP client and server library for Julia. It speaks HTTP/1.1 and HTTP/2, streams request and response bodies, and supports WebSockets and server-sent events. Reseau provides the TCP, DNS, and TLS layers.
Quick Start
Start a server, send it a request, and read the response body:
using HTTP
server = HTTP.serve!("127.0.0.1", 0) do req
return HTTP.Response(200; body = "hello from HTTP.jl")
end
resp = HTTP.get("http://127.0.0.1:$(HTTP.port(server))/hello")
HTTP.forceclose(server)
String(resp.body) # "hello from HTTP.jl"Port 0 asks the operating system for a free port; HTTP.port(server) returns the one it chose.
Where to Go Next
- The Client guide covers requests, streaming, reusable clients, request bodies, retries, and timeouts.
- The Server guide covers request and stream handlers, routing, static files, server-sent events, and server timeouts.
- The Protocols guide covers WebSockets and HTTP/2.
- The Migration guide explains how to update code written for HTTP.jl 1.x.
- The API reference lists every public name with its docstring.
Docs for LLMs
The documentation is also published as plain Markdown for LLM tools, following the llms.txt convention:
- llms.txt: a short index of the pages.
- llms-full.txt: every page, with all docstrings expanded, in one file.
Give either file to an assistant when you ask it about HTTP.jl.