Skip to main content

normalize_http_response

Function normalize_http_response 

Source
pub fn normalize_http_response(
    status: u16,
    content_type: Option<&str>,
    retry_after: Option<&str>,
    redirected: bool,
) -> Result<(), GeminiFailure>
Expand description

Maps a non-2xx/redirected HTTP response to the failure class. The Gemini protocol is SSE from POST ...:streamGenerateContent; a 200 with any other media type is rejected.