Crate zeptohttpc

Crate zeptohttpc 

Source
Expand description

This crate aims to be the smallest possible yet practically useful HTTP client built on top of the http and httparse crates.

use zeptohttpc::{http::Request, Options, RequestBuilderExt, RequestExt, ResponseExt};

let req = Request::get("http://httpbin.org/base64/emVwdG9odHRwYw%3D%3D").empty().unwrap();

let mut opts = Options::default();
opts.deadline = Some(Instant::now() + Duration::from_secs(10));

let resp = req.send_with_opts(opts).unwrap();

let body = resp.into_string().unwrap();
assert_eq!("zeptohttpc", body);

Re-exports§

pub use http;
pub use httparse;
pub use native_tls;
pub use rustls;
pub use serde;
pub use serde_json;

Structs§

BodyReader
Options

Enums§

BodyKind
Error

Traits§

BodyWriter
RequestBuilderExt
RequestExt
ResponseExt