5 releases
0.2.3 | Mar 27, 2024 |
---|---|
0.2.2 | Mar 22, 2024 |
0.2.1 | Sep 28, 2023 |
0.2.0 | Sep 28, 2023 |
0.1.0 | Sep 28, 2023 |
#235 in HTTP client
191 downloads per month
12KB
152 lines
Library to simplify calls to a RESTful API using a JSON file as the data source. GET, POST, PUT and DELETE methods are supported.
Example
Getting a list of posts from Json Placeholder
# use rest_json_client::{ApiClientBuilder, Authentication, Error};
# use json_placeholder_data::posts::Post;
#
# tokio_test::block_on(async {
let base = "https://jsonplaceholder.typicode.com/";
let posts = ApiClientBuilder::new(base)
.build()?
.get::<Vec<Post>>("posts")
.await?;
# assert_eq!(posts.len(), 100);
# Ok::<(), Error>(())
# });
Dependencies
~4–16MB
~199K SLoC