httpc

Crates.iohttpc
lib.rshttpc
version0.1.2
sourcesrc
created_at2021-03-14 22:27:31.321599
updated_at2022-02-18 16:53:31.194681
descriptionAn HTTP client working both natively and in WASM environments.
homepagehttps://github.com/d-e-s-o/httpc
repository
max_upload_size
id368916
size69,178
Daniel Müller (d-e-s-o)

documentation

README

pipeline crates.io Docs rustc

httpc

httpc is a Rust library crate providing an HTTP client that works both natively as well as in a bare bones WASM environment as used in web browsers. That is to say, the client code looks exactly the same and all that is needed to switch between the two is to compile for a different target platform (wasm32-unknown-unknown).

When compiling natively, the crate relies on hyper as the underlying HTTP client. When targeting WASM it works directly with the Fetch API as exposed through web-sys.

The crate does not yet provide functionality for all potential HTTP client use cases, though that is mostly a matter of implementing it: the interface should be able to cater to most use cases.

One of the main pain points of making HTTP requests in a certain application from a WASM environment is arguably testing it properly. httpc comes with a test suite covering supported functionality and it includes all the necessary setup code to make it run both natively as well as when targeting WASM.

Commit count: 0

cargo fmt