Extract status and headers from a [`reqwest::Response`].
(response: &reqwest::Response)
| 644 | |
| 645 | /// Extract status and headers from a [`reqwest::Response`]. |
| 646 | fn extract_response_metadata(response: &reqwest::Response) -> (u16, Vec<(String, String)>) { |
| 647 | let status = response.status().as_u16(); |
| 648 | let headers: Vec<(String, String)> = response |
| 649 | .headers() |
| 650 | .iter() |
| 651 | .map(|(k, v)| (k.to_string(), v.to_str().unwrap_or("").to_string())) |
| 652 | .collect(); |
| 653 | (status, headers) |
| 654 | } |
| 655 | |
| 656 | /// Forward a raw HTTP request to the backend configured in `route`. |
| 657 | /// |
no outgoing calls
no test coverage detected