This project is still highly experimental and therefore not to be used in production
An ergonomic, batteries-included HTTP Client for the lunatic runtime written in Rust.
- Plain bodies, JSON, urlencoded, multipart (see examples)
- Customizable redirect policy (IN PROGRESS)
- HTTP Proxies (IN PROGRESS)
- HTTPS via lunatic-native TLS (see examples)
- Cookie Store (IN PROGRESS)
- Changelog
This example uses Lunatic and enables some
optional features, so your Cargo.toml
could look like this:
[dependencies]
nightfly = { git = "https://github.com/SquattingSocrates/nightfly" }
lunatic = { git = "https://github.com/lunatic-solutions/lunatic-rs" }
And then the code:
use std::collections::HashMap;
#[lunatic::main]
fn main() {
let resp = nightfly::get("https://httpbin.org/ip")
.unwrap()
.json::<HashMap<String, String>>()
.unwrap();
println!("{:#?}", resp);
Ok(())
}
- A running version of the lunatic VM.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.