pub struct Response { /* private fields */ }Expand description
An HTTP response captured for a page.
Implementations§
Source§impl Response
impl Response
pub fn url(&self) -> &str
pub fn status(&self) -> u16
pub fn status_text(&self) -> &str
pub fn ok(&self) -> bool
pub fn headers(&self) -> &Headers
pub fn from_cache(&self) -> bool
pub fn from_service_worker(&self) -> bool
pub fn request(&self) -> Request
Sourcepub fn http_version(&self) -> String
pub fn http_version(&self) -> String
HTTP / protocol version reported by the server (e.g. “http/1.1”,
“h2”), derived from Network.Response.protocol. Empty string when not
captured.
Sourcepub fn security_details(&self) -> Option<SecurityDetails>
pub fn security_details(&self) -> Option<SecurityDetails>
TLS/SSL security details for the connection, if captured.
Sourcepub fn server_addr(&self) -> Option<ServerAddr>
pub fn server_addr(&self) -> Option<ServerAddr>
The remote server address this response came from, if 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 response headers (original case). Falls back to the lowercased
headers() map when raw headers were not captured.
Sourcepub fn finished(&self) -> Result<()>
pub fn finished(&self) -> Result<()>
Resolves successfully once Network.loadingFinished was observed for
this response; otherwise returns an error describing why.
Sourcepub async fn body(&self) -> Result<Vec<u8>>
pub async fn body(&self) -> Result<Vec<u8>>
Fetch the response body (cached after the first call).
pub async fn text(&self) -> Result<String>
pub async fn json(&self) -> Result<Value>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl !UnwindSafe for Response
impl Freeze for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
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