Skip to main content

Make HTTP requests
the Mojo way.

A native synchronous HTTP client. From a simple GET to persistent sessions and streaming responses — with an API that stays out of your way.

HTTP/1.1 · Verified HTTPS · Native JSON

main.mojoMojo
import req


def main() raises:
var response = req.get("https://example.com")
response.raise_for_status()
print(response.status_code)
print(response.text())

Everything a request needs.

A small, explicit API for the work between your application and the network.

Secure by default

Verified TLS and five-second phase timeouts. Redirects are a deliberate choice.

Connections that stay useful

Reuse connections and keep headers, authentication, and scoped cookies in one client.

Your data, your format

Send JSON, forms, or bytes. Read responses as text, structured JSON, or raw content.

Room for large responses

Read chunks as they arrive, with incremental gzip and deflate decoding.

Your first request starts here.

Build from source, then follow the guide to link the native transport and run a Mojo program.

Read the installation guide
Build from source
git clone https://github.com/mojoto/req.mojo.git
cd req.mojo
pixi install
make build