pub struct ResponseObject { /* private fields */ }Expand description
Response represents an HTTP response from a navigation operation.
Response objects are not created directly - they are returned from navigation methods like page.goto() or page.reload().
Implementations§
Source§impl ResponseObject
impl ResponseObject
Sourcepub fn new(
parent: Arc<dyn ChannelOwner>,
type_name: String,
guid: Arc<str>,
initializer: Value,
) -> Result<Self>
pub fn new( parent: Arc<dyn ChannelOwner>, type_name: String, guid: Arc<str>, initializer: Value, ) -> Result<Self>
Creates a new Response from protocol initialization
This is called by the object factory when the server sends a __create__ message
for a Response object.
Sourcepub fn status(&self) -> u16
pub fn status(&self) -> u16
Returns the status code of the response (e.g., 200 for a success).
See: https://playwright.dev/docs/api/class-response#response-status
Sourcepub fn status_text(&self) -> &str
pub fn status_text(&self) -> &str
Returns the status text of the response (e.g. usually an “OK” for a success).
See: https://playwright.dev/docs/api/class-response#response-status-text
Sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
Returns the URL of the response.
See: https://playwright.dev/docs/api/class-response#response-url
Sourcepub async fn body(&self) -> Result<Vec<u8>>
pub async fn body(&self) -> Result<Vec<u8>>
Returns the response body as bytes.
Sends a "body" RPC call to the Playwright server, which returns the body
as a base64-encoded binary string.
See: https://playwright.dev/docs/api/class-response#response-body
Sourcepub async fn security_details(&self) -> Result<Option<SecurityDetails>>
pub async fn security_details(&self) -> Result<Option<SecurityDetails>>
Returns TLS/SSL security details for HTTPS connections, or None for HTTP.
See: https://playwright.dev/docs/api/class-response#response-security-details
Sourcepub async fn server_addr(&self) -> Result<Option<RemoteAddr>>
pub async fn server_addr(&self) -> Result<Option<RemoteAddr>>
Returns the server’s IP address and port for this response, or None.
See: https://playwright.dev/docs/api/class-response#response-server-addr
Sourcepub async fn sizes(&self) -> Result<RequestSizes>
pub async fn sizes(&self) -> Result<RequestSizes>
Returns resource size information for this response.
See: https://playwright.dev/docs/api/class-request#request-sizes
Sourcepub async fn raw_headers(&self) -> Result<Vec<HeaderEntry>>
pub async fn raw_headers(&self) -> Result<Vec<HeaderEntry>>
Returns the raw response headers as name-value pairs (preserving duplicates).
Sends a "rawResponseHeaders" RPC call to the Playwright server.
See: https://playwright.dev/docs/api/class-response#response-headers-array
Trait Implementations§
Source§impl Clone for ResponseObject
impl Clone for ResponseObject
Source§fn clone(&self) -> ResponseObject
fn clone(&self) -> ResponseObject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more