Skip to main content

Module http

Module http 

Source
Expand description

HTTP helpers shared by the generated REST client codegen.

These are intentionally low-level and provider-agnostic so that the macro output stays small and the helpers can be unit-tested in isolation.

Functionsยง

attach_internal_token
Attach the platform-plane credential from provider (if any) to a REST RequestBuilder as the sensitive X-ToolKit-Internal-Token header.
body_to_byte_stream
Adapt any http_body::Body into a Stream<Item = Result<Bytes, E>> of data frames, dropping trailers.
build_request_url
Build a fully-qualified URL by substituting path parameters and appending a pre-encoded query string, returning TransportError on failure.
map_http_error
Map a non-success HTTP response into a TransportError.
parse_retry_after
Parse a Retry-After response header as a delta-seconds [Duration].
to_http_method
Map an HTTP method enum to http::Method.