#[non_exhaustive]pub struct APIRequestContextOptions {
pub base_url: Option<String>,
pub extra_http_headers: Option<HashMap<String, String>>,
pub ignore_https_errors: Option<bool>,
pub user_agent: Option<String>,
pub timeout: Option<f64>,
}Expand description
Options for creating a new APIRequestContext via APIRequest::new_context().
See: https://playwright.dev/docs/api/class-apirequest#api-request-new-context
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.base_url: Option<String>Base URL for all relative requests made with this context.
extra_http_headers: Option<HashMap<String, String>>Extra HTTP headers to be sent with every request.
ignore_https_errors: Option<bool>Whether to ignore HTTPS errors when making requests.
user_agent: Option<String>User agent string to send with requests.
timeout: Option<f64>Default timeout for fetch operations in milliseconds.
Implementations§
Source§impl APIRequestContextOptions
impl APIRequestContextOptions
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Base URL prepended to relative request paths.
Sourcepub fn extra_http_headers(self, headers: HashMap<String, String>) -> Self
pub fn extra_http_headers(self, headers: HashMap<String, String>) -> Self
Extra HTTP headers sent with every request.
Sourcepub fn ignore_https_errors(self, ignore: bool) -> Self
pub fn ignore_https_errors(self, ignore: bool) -> Self
Ignore HTTPS certificate errors.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
User-Agent header value.
Trait Implementations§
Source§impl Clone for APIRequestContextOptions
impl Clone for APIRequestContextOptions
Source§fn clone(&self) -> APIRequestContextOptions
fn clone(&self) -> APIRequestContextOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for APIRequestContextOptions
impl Debug for APIRequestContextOptions
Source§impl Default for APIRequestContextOptions
impl Default for APIRequestContextOptions
Source§fn default() -> APIRequestContextOptions
fn default() -> APIRequestContextOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for APIRequestContextOptions
impl RefUnwindSafe for APIRequestContextOptions
impl Send for APIRequestContextOptions
impl Sync for APIRequestContextOptions
impl Unpin for APIRequestContextOptions
impl UnsafeUnpin for APIRequestContextOptions
impl UnwindSafe for APIRequestContextOptions
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
Mutably borrows from an owned value. Read more