mirror of
https://github.com/kotovalexarian/jsonapis.rs.git
synced 2025-04-21 17:52:45 -04:00
19 lines
485 B
Rust
19 lines
485 B
Rust
#[cfg(feature = "client")]
|
|
use jsonapis::{Client, Document, Response};
|
|
|
|
#[cfg(not(feature = "client"))]
|
|
fn main() {}
|
|
|
|
#[cfg(feature = "client")]
|
|
fn main() {
|
|
// This example uses fake JSON:API
|
|
let client = Client::new("https://jsonapiplayground.reyesoft.com/v2");
|
|
|
|
let response: Response = client
|
|
.get("/stores", &[("filter[created_by]", "1,3".to_string())])
|
|
.unwrap();
|
|
|
|
let document: &Document = response.document();
|
|
|
|
println!("{:#?}", document);
|
|
}
|