Skip to main content

Module http_client

Module http_client 

Source
Expand description

Transport-independent HTTP requests, lazy response bodies, and errors.

use rig_http::http_client::{HeaderMap, bearer_auth_header};

let mut headers = HeaderMap::new();
bearer_auth_header(&mut headers, "example-token")?;

Modules§

framing
Incremental SSE and newline-delimited framing of response bytes. SSE dispatch requires a blank line; incomplete events are not flushed at EOF. NDJSON permits a final unterminated line through NdjsonFramer::finish.
middleware
Transport-boundary middleware for DynHttpClient. Attach hooks with with_middleware.
multipart
Transport-neutral multipart fields and byte encoding.

Structs§

Builder
An HTTP request builder
DynHttpClient
A type-erased, cheaply cloneable HTTP transport.
HeaderMap
A specialized multimap for header names and values.
HeaderValue
Represents an HTTP header field value.
Method
The Request Method (VERB)
MultipartForm
Generic multipart form data container
NoBody
Request
Represents an HTTP request.
Response
Represents an HTTP response
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
Uri
The URI component of a request.

Enums§

Error

Traits§

HttpClientExt
An HTTP client Rig sends through: unary, multipart and streaming requests.
HttpMiddleware
Transport-boundary hooks applied by DynHttpClient around every request.

Functions§

bearer_auth_header
make_auth_header
text

Type Aliases§

BoxedStream
The body of a streaming response: the transport’s own chunks, boxed.
LazyBody
LazyBytes
Result
StreamingResponse