18 releases (5 breaking)
0.5.2 | Oct 1, 2022 |
---|---|
0.5.1-alpha | Sep 22, 2022 |
0.4.0-alpha | Sep 22, 2022 |
0.3.1-alpha | Sep 21, 2022 |
0.0.5-alpha | Sep 20, 2022 |
#43 in #reqwest
144 downloads per month
Used in nexus_mods_api
47KB
921 lines
Raxios
Async-centered Rust library similar to the JS library "axios"
!DISCLAIMER!
While Raxios
is in an alpha state, consider any minor version changes to be breaking changes.
Raxios will not be out of Alpha state and stable until the 1.0.0 release.
Features
- JSON, XML, and URL-Encoded Serialization
- JSON Deserialization (XML and others to come)
- An "axios"-like api
Usage/Examples
use raxios::Raxios;
#[derive(serde::Serialize, serde::Deserialize, Debug)]
struct ToReceive {
field1: String
}
#[derive(serde::Serialize, serde::Deserialize, Debug)]
struct ToSend {
field1: String
}
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// An error _might_ occur here if you try to set non-valid headers in the Options
let client = Raxios::new("", None)?;
let data_to_send = ToSend { field1 : String::from("Hello World") };
let result = client
.post::<ToReceive, ToSend>("/endpoint", Some(data_to_send), None)
.await?;
println!("{0}", result.body.unwrap());
}
Documentation
License
docs.rs | downloads | Version |
---|---|---|
Dependencies
~4–19MB
~237K SLoC