pub struct HttpRequest {Show 14 fields
pub from_memory_cache: bool,
pub failure_text: Option<String>,
pub interception_id: Option<InterceptionId>,
pub response: Option<Response>,
pub headers: HashMap<String, String>,
pub frame: Option<FrameId>,
pub is_navigation_request: bool,
pub allow_interception: bool,
pub interception_handled: bool,
pub method: Option<String>,
pub url: Option<String>,
pub resource_type: Option<String>,
pub post_data: Option<String>,
pub redirect_chain: Vec<HttpRequest>,
/* private fields */
}Fields§
§from_memory_cache: boolIndicates if the response came from the memory cache.
failure_text: Option<String>Reason for failure, if any.
interception_id: Option<InterceptionId>ID used for request interception, if applicable.
response: Option<Response>Response data associated with the request.
headers: HashMap<String, String>HTTP headers of the request.
frame: Option<FrameId>ID of the frame that initiated the request.
Whether this is a navigation request.
allow_interception: boolWhether interception is allowed for this request.
interception_handled: boolWhether the interception has already been handled.
method: Option<String>HTTP method (e.g., GET, POST).
url: Option<String>Request URL.
resource_type: Option<String>Resource type (e.g., “Document”, “Script”).
post_data: Option<String>Raw post body, if present.
redirect_chain: Vec<HttpRequest>List of redirect requests leading to this one.
Implementations§
Source§impl HttpRequest
impl HttpRequest
Sourcepub fn new(
request_id: RequestId,
frame: Option<FrameId>,
interception_id: Option<InterceptionId>,
allow_interception: bool,
redirect_chain: Vec<HttpRequest>,
) -> Self
pub fn new( request_id: RequestId, frame: Option<FrameId>, interception_id: Option<InterceptionId>, allow_interception: bool, redirect_chain: Vec<HttpRequest>, ) -> Self
Creates a new HttpRequest with the given request ID and default values.
Sourcepub fn request_id(&self) -> &RequestId
pub fn request_id(&self) -> &RequestId
Returns the request ID.
Sourcepub fn set_response(&mut self, response: Response)
pub fn set_response(&mut self, response: Response)
Sets the response for this request.
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§fn clone(&self) -> HttpRequest
fn clone(&self) -> HttpRequest
Returns a duplicate of the value. Read more
1.0.0 · 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 HttpRequest
impl Debug for HttpRequest
Source§impl Default for HttpRequest
impl Default for HttpRequest
Source§fn default() -> HttpRequest
fn default() -> HttpRequest
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HttpRequest
impl RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnwindSafe for HttpRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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