Uses old Rust 2015
0.1.2 |
|
---|---|
0.1.1 |
|
0.1.0 |
|
#17 in #failed
8KB
153 lines
reru
A simple HTTP request client for Rust, inspired by unirest.
let mut res = String::new();
reru::post("https://httpbin.org/post")
.expect("failed to parse URL")
.param("show_env", "1")
.body_json(&["蟹", "Ferris"])
.expect("failed to serialize")
.request()
.expect("failed to send request")
.read_to_string(&mut res)
.expect("failed to read response");
println!("{}", res);
lib.rs
:
A simple HTTP request client library.
#Example
let mut res = String::new();
reru::post("https://httpbin.org/post")
.expect("failed to parse URL")
.param("show_env", "1")
.body_json(&["蟹", "Ferris"])
.expect("failed to serialize")
.request()
.expect("failed to send request")
.read_to_string(&mut res)
.expect("failed to read response");
println!("{}", res);
Dependencies
~5.5MB
~116K SLoC