pub struct XhrCapture {
pub url: String,
pub status: u16,
pub headers: HashMap<String, String>,
pub body: Bytes,
}Expand description
A captured XHR/fetch response recorded during page navigation.
When [BrowserConfig::capture_xhr] is set with a URL pattern, matching
XHR/fetch responses are intercepted and stored in this struct. This lets you
extract API data that the page fetches in the background without having to
parse it out of the rendered HTML.
Fields§
§url: StringURL of the captured XHR/fetch request. This is the full URL including query parameters.
status: u16HTTP status code of the captured response (e.g. 200, 404).
headers: HashMap<String, String>Response headers of the captured request.
Useful for checking Content-Type or pagination headers.
body: BytesRaw response body bytes.
For JSON APIs you can deserialize this with serde_json::from_slice.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for XhrCapture
impl RefUnwindSafe for XhrCapture
impl Send for XhrCapture
impl Sync for XhrCapture
impl Unpin for XhrCapture
impl UnsafeUnpin for XhrCapture
impl UnwindSafe for XhrCapture
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> 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