A HTTP Client built on top of the reqwest package for accessing the Zuora Billing REST API
This example uses serde_json to prepare the data for a GET request, so your Cargo.toml
could look like this:
toml
[dependencies]
zuora_rest_client = "0.1.0"
serde_json = "1"
And then the code:
```rust use std::env; use std::process; use zuorarestclient::Zuora;
fn main() -> Result<(), Box
let mut client = Zuora::new(
env::var("ZUORA_CLIENT_ID").unwrap_or_default(),
env::var("ZUORA_CLIENT_SECRET").unwrap_or_default(),
args[1].clone(),
args[2].clone(),
3,
);
let token = client.generate_token();
println!("{:?}", token);
let get = client.get("/catalog/products", serde_json::from_str("{}").unwrap());
println!("{:?}", get);
Ok(())
} ```
Licensed under