Skip to content

Commit

Permalink
Merge pull request #54 from sagebind/rebrand
Browse files Browse the repository at this point in the history
After much deliberation the new project name is ready! Naming things is hard, but still, I don't think we'll have to pick a name again after this one time.

- Rename crate from `chttp` to `isahc` and update referenced wherever they are used.
- Introduce a new mascot for the project.
- Bump version to 0.6.
- Update and expand the project readme.
- Update license year.

Fixes #36.
  • Loading branch information
sagebind authored Aug 3, 2019
2 parents 26013a2 + 1b88a96 commit 2b2d427
Show file tree
Hide file tree
Showing 26 changed files with 389 additions and 131 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "chttp"
version = "0.5.4"
name = "isahc"
version = "0.6.0"
description = "The practical HTTP client that is fun to use."
authors = ["Stephen M. Coakley <[email protected]>"]
license = "MIT"
keywords = ["http", "request", "client", "async", "curl"]
categories = ["web-programming::http-client"]
repository = "https://github.com/sagebind/chttp"
documentation = "https://docs.rs/chttp/"
repository = "https://github.com/sagebind/isahc"
documentation = "https://docs.rs/isahc/"
readme = "README.md"
edition = "2018"

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Stephen M. Coakley
Copyright (c) 2019 Stephen M. Coakley

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
49 changes: 32 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# cHTTP
# Isahc (formerly cHTTP)

The practical HTTP client that is fun to use.
Say hello to Isahc (pronounced like _Isaac_), the practical HTTP client that is fun to use.

[![Crates.io](https://img.shields.io/crates/v/chttp.svg)](https://crates.io/crates/chttp)
[![Documentation](https://docs.rs/chttp/badge.svg)][documentation]
[![Crates.io](https://img.shields.io/crates/v/isahc.svg)](https://crates.io/crates/isahc)
[![Documentation](https://docs.rs/isahc/badge.svg)][documentation]
![License](https://img.shields.io/badge/license-MIT-blue.svg)

## Key features
Expand All @@ -19,42 +19,54 @@ The practical HTTP client that is fun to use.
- Network socket configuration.
- Uses the [http] crate as an interface for requests and responses.

## Why cHTTP and not X?
<img src="media/isahc.svg.png" width="320" align="right">

cHTTP provides an easy-to-use, flexible, and idiomatic Rust API that makes sending HTTP requests a breeze. The goal of cHTTP is to make the easy way _also_ provide excellent performance and correctness for common use cases.
## What is Isahc?

cHTTP 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:
Isahc is an acronym that stands for **I**ncredible **S**treaming **A**synchronous **H**TTP **C**lient, 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.

## No, _who_ is Isahc?

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!

## Why use Isahc and not X?

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:

- It is a stable, actively developed, and very popular library.
- It is well-supported on a diverse list of platforms.
- The HTTP protocol has a lot of unexpected gotchas across different servers, and curl has been around the block long enough to handle many of them.
- It is well optimized and offers the ability to implement asynchronous requests.

Safe Rust bindings to libcurl are provided by the [curl](https://crates.io/crates/curl) crate, which you can use yourself if you want to use curl directly. cHTTP 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.
Safe Rust bindings to libcurl are provided by the [curl](https://crates.io/crates/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.

## Installation

Install via Cargo by adding to your `Cargo.toml` file:

```toml
[dependencies]
chttp = "0.5"
isahc = "0.6"
```

### Supported Rust versions

The current release is only guaranteed to work with the latest stable Rust compiler. When cHTTP reaches version `1.0`, a more conservative policy will be adopted.
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.

### Feature flags

cHTTP is designed to be as "pay-as-you-need" as possible using Cargo feature
Isahc is designed to be as "pay-as-you-need" as possible using Cargo feature
flags and optional dependencies. Unstable features are also initially
released behind feature flags until they are stabilized. You can add the
feature names below to your `Cargo.toml` file to enable them:

```toml
[dependencies.chttp]
version = "0.5"
[dependencies.isahc]
version = "0.6"
features = ["psl"]
```

Expand All @@ -69,26 +81,29 @@ Below is a list of all available feature flags and their meanings.

## [Documentation]

Please check out the [documentation] for details on what cHTTP can do and how to use it.
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.
let mut response = chttp::get("https://example.org")?
let mut response = isahc::get("https://example.org")?
// Read the response body into a string and print it to standard output.
let body = response.body_mut().text()?;
println!("{}", body);
```

## License

This library is licensed under the MIT license. See the [LICENSE](LICENSE) file for details.
This project's source code and documentation is licensed under the MIT license. See the [LICENSE](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.


[async/await]: https://rust-lang.github.io/async-book/01_getting_started/04_async_await_primer.html
[documentation]: https://docs.rs/chttp
[documentation]: https://docs.rs/isahc
[http]: https://github.com/hyperium/http
[libcurl]: https://curl.haxx.se/libcurl/
[multi interface]: https://curl.haxx.se/libcurl/c/libcurl-multi.html
[rust]: https://www.rustlang.org
[serde]: https://serde.rs
4 changes: 2 additions & 2 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "chttp-benchmarks"
name = "isahc-benchmarks"
version = "0.0.0"
edition = "2018"
publish = false

[dependencies.chttp]
[dependencies.isahc]
path = ".."

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benches/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ fn benchmark(c: &mut Criterion) {
)
});

c.bench_function("download 64K: chttp", move |b| {
c.bench_function("download 64K: isahc", move |b| {
use std::io::Read;

let server = server::spawn(|_| server::static_response(&DATA));
let endpoint = server.endpoint();

b.iter_batched(
|| chttp::Client::new(),
|| isahc::Client::new(),
|client| {
let mut body = Vec::new();

Expand Down
4 changes: 2 additions & 2 deletions examples/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#![cfg(feature = "nightly")]
#![feature(async_await)]

use chttp::prelude::*;
use isahc::prelude::*;

fn main() -> Result<(), chttp::Error> {
fn main() -> Result<(), isahc::Error> {
futures::executor::block_on(async {
let mut response = Request::get("http://example.org")
.body(())?
Expand Down
8 changes: 4 additions & 4 deletions examples/http2.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use chttp::prelude::*;
use isahc::prelude::*;

fn main() -> Result<(), chttp::Error> {
fn main() -> Result<(), isahc::Error> {
let response = Request::get("https://nghttp2.org")
.preferred_http_version(chttp::http::Version::HTTP_2)
.preferred_http_version(isahc::http::Version::HTTP_2)
.body(())
.map_err(Into::into)
.and_then(chttp::send)?;
.and_then(isahc::send)?;

println!("{:?}", response.headers());

Expand Down
6 changes: 3 additions & 3 deletions examples/parallel_requests.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//! In this example, we demonstrate cHTTP's ability to run many requests
//! In this example, we demonstrate Isahc's ability to run many requests
//! simultaneously with no extra cost. Concurrent requests may be made in the
//! same thread, or from different threads as in this example.
//!
//! We're using Rayon here to make parallelism easy.
use chttp::prelude::*;
use isahc::prelude::*;
use rayon::prelude::*;
use std::env;
use std::time::Instant;

fn main() -> Result<(), chttp::Error> {
fn main() -> Result<(), isahc::Error> {
let count = env::args()
.nth(1)
.and_then(|s| s.parse::<u32>().ok())
Expand Down
4 changes: 2 additions & 2 deletions examples/simple.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use chttp::prelude::*;
use isahc::prelude::*;

fn main() -> Result<(), chttp::Error> {
fn main() -> Result<(), isahc::Error> {
let client = HttpClient::new();
let mut response = client.get("http://example.org")?;

Expand Down
4 changes: 2 additions & 2 deletions examples/version.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! A simple example that prints the version of chttp and libcurl being used.
//! A simple example that prints the version of isahc and libcurl being used.
//!
//! This example is useful to run on various systems when troubleshooting
//! version-related issues.
fn main() {
println!("version: {}", chttp::version());
println!("version: {}", isahc::version());
}
Loading

0 comments on commit 2b2d427

Please sign in to comment.