Build an HTTP request from components.
(
method: hyper::Method,
path: &str,
body: Full<Bytes>,
content_type: Option<&str>,
)
| 298 | |
| 299 | /// Build an HTTP request from components. |
| 300 | fn build_request( |
| 301 | method: hyper::Method, |
| 302 | path: &str, |
| 303 | body: Full<Bytes>, |
| 304 | content_type: Option<&str>, |
| 305 | ) -> Request<Full<Bytes>> { |
| 306 | let mut builder = Request::builder() |
| 307 | .method(method) |
| 308 | .uri(format!("http://localhost{path}")) |
| 309 | .header("Host", "localhost"); |
| 310 | if let Some(ct) = content_type { |
| 311 | builder = builder.header("Content-Type", ct); |
| 312 | } |
| 313 | builder.body(body).expect("valid request") |
| 314 | } |
| 315 | |
| 316 | /// Send a pre-built HTTP request and return status + body bytes. |
| 317 | async fn send_request( |
nothing calls this directly
no outgoing calls
no test coverage detected