Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d-e-s-o/httpc
An HTTP client working both natively and in WASM environments.
https://github.com/d-e-s-o/httpc
http-client http-requests httpclient rust rust-crate rust-lang
Last synced: about 2 months ago
JSON representation
An HTTP client working both natively and in WASM environments.
- Host: GitHub
- URL: https://github.com/d-e-s-o/httpc
- Owner: d-e-s-o
- License: apache-2.0
- Created: 2021-04-23T05:15:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-02-18T16:53:48.000Z (almost 3 years ago)
- Last Synced: 2024-10-11T22:13:22.504Z (3 months ago)
- Topics: http-client, http-requests, httpclient, rust, rust-crate, rust-lang
- Language: Rust
- Homepage:
- Size: 80.1 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
[![pipeline](https://gitlab.com/d-e-s-o/httpc/badges/master/pipeline.svg)](https://gitlab.com/d-e-s-o/httpc/commits/master)
[![crates.io](https://img.shields.io/crates/v/httpc.svg)](https://crates.io/crates/httpc)
[![Docs](https://docs.rs/httpc/badge.svg)](https://docs.rs/httpc)
[![rustc](https://img.shields.io/badge/rustc-1.54+-blue.svg)](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html)httpc
=====- [Documentation][docs-rs]
- [Changelog](CHANGELOG.md)**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`][hyper] as the
underlying HTTP client. When targeting WASM it works directly with the
[Fetch API][fetch-api] as exposed through [`web-sys`][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.[docs-rs]: https://docs.rs/crate/httpc
[hyper]: https://crates.io/crates/hyper
[fetch-api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
[web-sys]: https://crates.io/crates/web-sys