Say hello to Isahc (pronounced like Isaac), the practical HTTP client that is fun to use.
Formerly known as [chttp].
Isahc is an acronym that stands for Incredible Streaming Asynchronous HTTP Client, and as the name implies, is an asynchronous HTTP client for the [Rust] language. It uses [libcurl] as an HTTP engine inside, and provides an easy-to-use API on top that integrates with Rust idioms.
Oh, you mean Isahc the dog! He's an adorable little Siberian husky who loves to play fetch with webservers every day and has a very cURLy tail. He shares a name with the project and acts as the project's mascot.
You can pet him all day if you like, he doesn't mind. Though, he prefers it if you pet him in a standards-compliant way!
Isahc provides an easy-to-use, flexible, and idiomatic Rust API that makes sending HTTP requests a breeze. The goal of Isahc is to make the easy way also provide excellent performance and correctness for common use cases.
Isahc uses [libcurl] under the hood to handle the HTTP protocol and networking. Using curl as an engine for an HTTP client is a great choice for a few reasons:
Safe Rust bindings to libcurl are provided by the [curl crate], which you can use yourself if you want to use curl directly. Isahc delivers a lot of value on top of vanilla curl, by offering a simpler, more idiomatic API and doing the hard work of turning the powerful [multi interface] into a futures-based API.
Please check out the [documentation] for details on what Isahc can do and how to use it. To get you started, here is a really simple example that spits out the response body from https://example.org:
rust
// Send a GET request and wait for the response headers.
let mut response = isahc::get("https://example.org")?;
// Read the response body into a string and print it to standard output.
println!("{}", response.text()?);
Click here for built documentation from the latest master
build.
Install via Cargo by adding to your Cargo.toml
file:
toml
[dependencies]
isahc = "0.9"
The current release is only guaranteed to work with the latest stable Rust compiler. When Isahc reaches version 1.0
, a more conservative policy will be adopted.
Non-goals:
This project's source code and documentation is licensed under the MIT license. See the LICENSE file for details.
The "Isahc" logo and mascot may only be used as required for reasonable and customary use in describing the Isahc project and in redistribution of the project.