Tristan Peralta

Systems 2026

httpc3

One HTTP request API for C3, with replaceable backends.

httpc3 gives C3 libraries one request API that behaves the same on every platform. It knows nothing about any particular web API: JSON and endpoint logic stay in the libraries above it, such as spotc3, lastfmc3, and musicbrainzc3.

One API, several transports

get, post, put, delete, and request cover any method, with headers, a body, and a timeout. The transport sits behind a backend interface:

  • CurlBackend — libcurl, the first backend, for Linux and Android.
  • FakeBackend — scripted responses for tests, with no network.
  • FetchBackend — the browser’s fetch, for WASM, later.

The application chooses a backend; the code above it does not change.

Async without a runtime

send blocks. send_async returns at once, and Client.poll() delivers finished responses on the thread that calls it. There is no hidden thread and no callback that takes over the program, which is what lets the same client work inside a render loop or a browser’s main thread.

Status

Early. Blocking and async requests through curl work, along with retries, the fake backend, and the encoding helpers. The WASM backend is planned, not finished.