Function grin_api::client::get[][src]

pub fn get<T>(url: &str, api_secret: Option<String>) -> Result<T, Error> where
    T: Deserialize<'de>, 
Expand description

Helper function to easily issue a HTTP GET request against a given URL that returns a JSON object. Handles request building, JSON deserialization and response code checking. This function spawns a new Tokio runtime, which means it is pretty inefficient for multiple requests. In those situations you are probably better off creating a runtime once and spawning get_async tasks on it