sanity 0.1.0

The open source client for consuming https://sanity.io with Rust, based on reqwest.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
extern crate reqwest;
extern crate serde_json;
use serde_json::Value;

///
/// ### Convenience function for getting JSON from return string via `serde`

pub fn get_json(mut reqwest_res: reqwest::Response) -> Result<Value, Box<dyn std::error::Error>> {
  let data: Value = serde_json::from_str(&reqwest_res.text()?)?;

  Ok(data)
}