/// Deserialize the response body into the given type
Deserialize the response body into the given type
Deserialize the response body into the given type
pub fn deserialize<T: DeserializeOwned>(&self) -> Result<T> {
        if self.ok() {
            Ok(serde_json::from_reader(match self.body {
                Some(ref body) => body,
                None => &b""[..],
            })
                .map_err(|_| RequestError::InvalidJson)?)
        } else {
            Err(RequestError::RequestFailed)
        }
    }
pub fn deserialize < T : DeserializeOwned > ( & self ) -> Result < T > { if self . ok ( ) { Ok ( serde_json :: from_reader ( match self . body { Some ( ref body ) => body , None => & b" " [ .. ] , } ) . map_err ( | _ | RequestError :: InvalidJson ) ? ) } else { Err ( RequestError :: RequestFailed ) } }
Deserialize the response body into the given type
Deserialize the response body into the given type
&self