pub struct RequestConfig {Show 15 fields
pub headers: Option<HashMap<String, String>>,
pub cookies: Option<HashMap<String, String>>,
pub params: Option<HashMap<String, String>>,
pub timeout_secs: Option<u64>,
pub follow_redirects: Option<FollowRedirects>,
pub max_redirects: Option<usize>,
pub retries: Option<u32>,
pub retry_delay_secs: Option<u64>,
pub proxy: Option<Proxy>,
pub verify: Option<bool>,
pub impersonate: Option<Impersonate>,
pub stealthy_headers: Option<bool>,
pub data: Option<Vec<u8>>,
pub json: Option<Value>,
pub auth: Option<(String, String)>,
}Expand description
Per-request configuration overrides that take precedence over FetcherConfig defaults.
Every field is Option – when None, the corresponding value from the fetcher’s
FetcherConfig is used instead. This lets you customize individual requests
(e.g., use a different proxy or longer timeout) without affecting the global config.
Pass this to methods like Fetcher::get() and FetcherSession::post().
Fields§
§headers: Option<HashMap<String, String>>Custom headers for this request. These are merged with the fetcher’s default headers, with per-request values taking precedence on name collisions.
Cookies to send with this request, serialized into a single Cookie header.
In a FetcherSession, the session’s cookie jar is used in addition to these.
params: Option<HashMap<String, String>>URL query parameters to append to the request URL.
timeout_secs: Option<u64>Request timeout override in seconds. When set, this replaces the fetcher’s default timeout for this single request.
follow_redirects: Option<FollowRedirects>Redirect policy override for this request.
max_redirects: Option<usize>Maximum redirects override for this request.
retries: Option<u32>Retry count override for this request. Set to Some(1) to disable retries.
retry_delay_secs: Option<u64>Retry delay override in seconds for this request.
proxy: Option<Proxy>Proxy override for this request. Overrides both the static proxy and the proxy rotator for this single request.
verify: Option<bool>TLS verification override for this request.
impersonate: Option<Impersonate>Browser impersonation override for this request.
stealthy_headers: Option<bool>Stealth headers override for this request.
data: Option<Vec<u8>>Raw request body bytes. Mutually exclusive with json – if both are set,
json takes precedence.
json: Option<Value>JSON request body. Automatically serialized and sent with a
Content-Type: application/json header. Takes precedence over data.
auth: Option<(String, String)>HTTP basic authentication credentials as (username, password).
Trait Implementations§
Source§impl Debug for RequestConfig
impl Debug for RequestConfig
Source§impl Default for RequestConfig
impl Default for RequestConfig
Source§fn default() -> RequestConfig
fn default() -> RequestConfig
Auto Trait Implementations§
impl Freeze for RequestConfig
impl RefUnwindSafe for RequestConfig
impl Send for RequestConfig
impl Sync for RequestConfig
impl Unpin for RequestConfig
impl UnsafeUnpin for RequestConfig
impl UnwindSafe for RequestConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more