Crates.io | nightfly |
lib.rs | nightfly |
version | 0.1.6 |
source | src |
created_at | 2022-11-17 12:01:26.789783 |
updated_at | 2023-05-09 12:42:30.969087 |
description | higher level HTTP client library for the lunatic runtime |
homepage | |
repository | https://github.com/SquattingSocrates/nightfly |
max_upload_size | |
id | 717160 |
size | 339,642 |
This project is an ongoing effort to port the reqwest library to the lunatic runtime
An ergonomic, batteries-included HTTP Client for the lunatic runtime written in Rust.
Plain bodies, JSON, urlencoded, multipart (see examples)
Redirects with different policies
HTTPS via lunatic-native TLS (see examples)
Cookie Store
Customizable function-based redirect policy (IN PROGRESS)
HTTP Proxies (IN PROGRESS)
This example uses Lunatic and enables some
optional features, so your Cargo.toml
could look like this:
[dependencies]
nightfly = { "0.1.0" }
lunatic = { "0.12.0" }
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(())
}
Licensed under either of
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.