pub struct HttpRequest {Show 16 fields
pub request_id: RequestId,
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>,
pub created_at: Instant,
}Fields§
§request_id: RequestIdUnique ID of the request.
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.
created_at: InstantWhen this entry was created — used to evict orphaned requests whose
loadingFinished / loadingFailed events were never received.
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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more