talira

A simple, safe HTTP client

open sourceMIT OR Apache-2.0self-hostablefree

ureq is a blocking HTTP client for Rust, written in pure Rust with unsafe code forbidden. It uses blocking I/O instead of async, which keeps its API simple and its dependency tree small, and suits CLIs and scripts that don't run an async runtime. An Agent holds a connection pool and an optional cookie store; features turned on as needed add JSON through serde, multipart forms, gzip and brotli, charset decoding and SOCKS proxies. TLS comes from rustls (the default) or native-tls, with Mozilla's roots or the platform's verifier, and timeouts can be set for the whole call or each phase. Martin Algesten created it; reqwest is the usual async alternative.

Problems it solves

  • make HTTP requests from a small Rust CLI without pulling in Tokio and an async runtime
  • call a JSON API from synchronous Rust code with as few dependencies as possible
  • an HTTP client crate with no unsafe code for a security-sensitive Rust tool
  • set separate timeouts for DNS, connect, sending and receiving in a blocking Rust client
  • send Rust HTTP requests through a SOCKS5 proxy or the HTTPS_PROXY environment variable
  • verify TLS certificates with the operating system's trust store instead of a bundled list
  • keep my Rust binary small while still downloading files over HTTPS

Features

  • pure Rust, forbids unsafe code
  • blocking I/O, no async runtime
  • Agent with connection pooling and an optional cookie store
  • rustls (default) or native-tls
  • webpki roots or the platform certificate verifier
  • JSON via serde, multipart forms, form encoding
  • gzip and brotli decompression, charset decoding
  • HTTP CONNECT and SOCKS4/5 proxies, proxy environment variables
  • global, per-call and per-phase timeouts
  • based on the http crate's types
View 1 more
  • pluggable Transport and Resolver traits (unversioned)

Limitations

  • Doesn't offer an async API: it uses blocking I/O to keep the API simple and dependencies few1

Capabilities

Has an APIplan not known

Alternatives

The same job

These do what ureq does.

  1. reqwest An ergonomic, batteries-included HTTP Client for Rust.
  2. Isahc The practical HTTP client that is fun to use.
  3. hyper A protective and efficient HTTP library for all.

Compare ureq with the top 3