| 450 | /// Response from a completed HTTP request. |
| 451 | #[derive(Clone)] |
| 452 | pub struct Response { |
| 453 | /// The URL we ended up at. This can differ from the request url when we have followed redirects. |
| 454 | pub url: String, |
| 455 | |
| 456 | /// Did we get a 2xx response code? |
| 457 | pub ok: bool, |
| 458 | |
| 459 | /// Status code (e.g. `404` for "File not found"). |
| 460 | pub status: u16, |
| 461 | |
| 462 | /// Status text (e.g. "File not found" for status code `404`). |
| 463 | pub status_text: String, |
| 464 | |
| 465 | /// The returned headers. |
| 466 | pub headers: Headers, |
| 467 | |
| 468 | /// The raw bytes of the response body. |
| 469 | pub bytes: Vec<u8>, |
| 470 | } |
| 471 | |
| 472 | impl Response { |
| 473 | pub fn text(&self) -> Option<&str> { |
no outgoing calls
no test coverage detected