Skip to main content

forward_request

Function forward_request 

Source
pub async fn forward_request(
    client: &Client,
    method: &str,
    target_url: &str,
    request_headers: &HeaderMap,
    body: Option<String>,
) -> Response
Expand description

Forward a request to an upstream URL, streaming the response back.

Auth headers (authorization, x-api-key, anthropic-version, x-goog-api-key) pass through unchanged. The response body is streamed directly — SSE and chunked responses are not buffered.