pub fn http_request(
method: Method,
url: &str,
headers: &[(String, String)],
body: Option<&[u8]>,
) -> Result<HttpResponse, String>Expand description
Perform a synchronous HTTP request via bun_http::AsyncHTTP::send_sync().
This function:
- Parses the URL via bun_url::URL::parse
- Builds request headers via HeaderBuilder
- Initializes AsyncHTTP via init_sync()
- Executes the request via send_sync() (blocking)
- Extracts the response into an owned HttpResponse