(self)
| 221 | pub fn text(&self) -> HttpResult<String> { |
| 222 | String::from_utf8(self.body.clone()).map_err(|err| { |
| 223 | HttpError::new( |
| 224 | self.id, |
| 225 | self.url.clone(), |
| 226 | HttpErrorKind::Text, |
| 227 | err.to_string(), |
| 228 | ) |
| 229 | }) |
| 230 | } |
| 231 | |
| 232 | pub fn variant(&self) -> HttpResult<Variant> { |
| 233 | let value: JsonValue = serde_json::from_slice(&self.body).map_err(|err| { |
| 234 | HttpError::new( |
| 235 | self.id, |
| 236 | self.url.clone(), |
| 237 | HttpErrorKind::Json, |
| 238 | err.to_string(), |
no outgoing calls
no test coverage detected