pub struct Request { /* private fields */ }Expand description
An HTTP request captured for a page.
Implementations§
Source§impl Request
impl Request
pub fn url(&self) -> &str
pub fn method(&self) -> &str
pub fn headers(&self) -> &Headers
pub fn resource_type(&self) -> &str
Sourcepub fn request_id(&self) -> &str
pub fn request_id(&self) -> &str
The CDP requestId backing this request.
Sourcepub async fn response(&self) -> Result<Option<Response>>
pub async fn response(&self) -> Result<Option<Response>>
The response to this request, if it has arrived yet.
Sourcepub fn post_data(&self) -> Option<String>
pub fn post_data(&self) -> Option<String>
Raw request body (Network.requestWillBeSent.postData), if any.
Sourcepub fn post_data_buffer(&self) -> Option<Vec<u8>>
pub fn post_data_buffer(&self) -> Option<Vec<u8>>
Raw request body as bytes.
Sourcepub fn post_data_json<T: DeserializeOwned>(&self) -> Option<Result<T>>
pub fn post_data_json<T: DeserializeOwned>(&self) -> Option<Result<T>>
Parsed request body, deserialized as T. Returns None if there is no
post data; returns an error if the body is not valid JSON for T.
Sourcepub fn redirected_from(&self) -> Option<Request>
pub fn redirected_from(&self) -> Option<Request>
The request this one redirected from (the previous hop in the redirect chain), if any.
Sourcepub fn redirected_to(&self) -> Option<Request>
pub fn redirected_to(&self) -> Option<Request>
The request this one redirected to (the next hop in the redirect chain), if any.
Sourcepub fn failure(&self) -> Option<String>
pub fn failure(&self) -> Option<String>
Failure text captured from Network.loadingFailed.errorText, if the
request failed to load.
Sourcepub fn timing(&self) -> Option<Timing>
pub fn timing(&self) -> Option<Timing>
Timing information for this request, if it has been captured.
Sourcepub fn sizes(&self) -> Option<Sizes>
pub fn sizes(&self) -> Option<Sizes>
Transferred size information, if Network.loadingFinished was received.
Sourcepub fn all_headers(&self) -> Headers
pub fn all_headers(&self) -> Headers
All raw request headers (original case). Falls back to the lowercased
headers() map when raw headers were not captured.