Skip to main content

Module native_request

Module native_request 

Source
Expand description

Native request builder for http::Uri targets.

The high-level request builder is backed by url::Url, so it is only available with the high-level-url feature and carries the url/idna/ICU dependency closure with it. This module is the URL-free counterpart: a builder that takes an already-parsed http::Uri and dispatches through the same native frame-preserving transport as crate::Client::execute_http_body. It is available in every profile, including the minimal native slice that compiles without url.

§Semantics

The native path dispatches exactly once. It applies no redirects, no logical retries, no cookies, no authentication, no response decompression, and no decoded-body limits. The caller owns IDNA and punycode conversion before constructing the http::Uri, and the built-in proxy and HTTP/3 routes reject native frame bodies.

§Relationship to the high-level builder

crate::request::RequestBuilder and this builder are deliberately separate types rather than one type with two target representations. The high-level builder owns URL semantics (query pairs, relative redirect resolution, cookie and proxy matching by URL) and returns the high-level crate::response::Response. This builder owns only the wire-level request and returns a plain http::Response. Keeping them separate means a native consumer can depend on the transport without pulling in the URL layer, and it keeps the existing high-level signatures intact.

Structs§

NativeRequestBuilder
Builder for a native request addressed by an [http::Uri.