Skip to main content

NetworkClient

Struct NetworkClient 

Source
pub struct NetworkClient { /* private fields */ }
Expand description

Client for Network domain commands.

Implementations§

Source§

impl NetworkClient

Source

pub async fn set_accepted_encodings( &self, params: SetAcceptedEncodingsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.

Source

pub async fn clear_accepted_encodings_override( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Clears accepted encodings set by setAcceptedEncodings

Source

pub async fn can_clear_browser_cache( &self, session_id: Option<&str>, ) -> Result<CanClearBrowserCacheReturns, CdpError>

Tells whether clearing browser cache is supported.

Source

pub async fn can_clear_browser_cookies( &self, session_id: Option<&str>, ) -> Result<CanClearBrowserCookiesReturns, CdpError>

Tells whether clearing browser cookies is supported.

Source

pub async fn can_emulate_network_conditions( &self, session_id: Option<&str>, ) -> Result<CanEmulateNetworkConditionsReturns, CdpError>

Tells whether emulation of network conditions is supported.

Source

pub async fn clear_browser_cache( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Clears browser cache.

Source

pub async fn clear_browser_cookies( &self, session_id: Option<&str>, ) -> Result<Value, CdpError>

Clears browser cookies.

Source

pub async fn continue_intercepted_request( &self, params: ContinueInterceptedRequestParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes. If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId. Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.

Source

pub async fn delete_cookies( &self, params: DeleteCookiesParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Deletes browser cookies with matching name and url or domain/path/partitionKey pair.

Source

pub async fn disable(&self, session_id: Option<&str>) -> Result<Value, CdpError>

Disables network tracking, prevents network events from being sent to the client.

Source

pub async fn emulate_network_conditions( &self, params: EmulateNetworkConditionsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Activates emulation of network conditions. This command is deprecated in favor of the emulateNetworkConditionsByRule and overrideNetworkState commands, which can be used together to the same effect.

Source

pub async fn emulate_network_conditions_by_rule( &self, params: EmulateNetworkConditionsByRuleParams, session_id: Option<&str>, ) -> Result<EmulateNetworkConditionsByRuleReturns, CdpError>

Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated Network.emulateNetworkConditions this method does not affect navigator state. Use Network.overrideNetworkState to explicitly modify navigator behavior.

Source

pub async fn override_network_state( &self, params: OverrideNetworkStateParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Override the state of navigator.onLine and navigator.connection.

Source

pub async fn enable( &self, params: EnableParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Enables network tracking, network events will now be delivered to the client.

Source

pub async fn get_all_cookies( &self, session_id: Option<&str>, ) -> Result<GetAllCookiesReturns, CdpError>

Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field. Deprecated. Use Storage.getCookies instead.

Source

pub async fn get_certificate( &self, params: GetCertificateParams, session_id: Option<&str>, ) -> Result<GetCertificateReturns, CdpError>

Returns the DER-encoded certificate.

Source

pub async fn get_cookies( &self, params: GetCookiesParams, session_id: Option<&str>, ) -> Result<GetCookiesReturns, CdpError>

Returns all browser cookies for the current URL. Depending on the backend support, will return detailed cookie information in the cookies field.

Source

pub async fn get_response_body( &self, params: GetResponseBodyParams, session_id: Option<&str>, ) -> Result<GetResponseBodyReturns, CdpError>

Returns content served for the given request.

Source

pub async fn get_request_post_data( &self, params: GetRequestPostDataParams, session_id: Option<&str>, ) -> Result<GetRequestPostDataReturns, CdpError>

Returns post data sent with the request. Returns an error when no data was sent with the request.

Source

pub async fn get_response_body_for_interception( &self, params: GetResponseBodyForInterceptionParams, session_id: Option<&str>, ) -> Result<GetResponseBodyForInterceptionReturns, CdpError>

Returns content served for the given currently intercepted request.

Source

pub async fn take_response_body_for_interception_as_stream( &self, params: TakeResponseBodyForInterceptionAsStreamParams, session_id: Option<&str>, ) -> Result<TakeResponseBodyForInterceptionAsStreamReturns, CdpError>

Returns a handle to the stream representing the response body. Note that after this command, the intercepted request can’t be continued as is – you either need to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified.

Source

pub async fn replay_xhr( &self, params: ReplayXhrParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.

Source

pub async fn search_in_response_body( &self, params: SearchInResponseBodyParams, session_id: Option<&str>, ) -> Result<SearchInResponseBodyReturns, CdpError>

Searches for given string in response content.

Source

pub async fn set_blocked_ur_ls( &self, params: SetBlockedUrLsParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Blocks URLs from loading.

Source

pub async fn set_bypass_service_worker( &self, params: SetBypassServiceWorkerParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Toggles ignoring of service worker for each request.

Source

pub async fn set_cache_disabled( &self, params: SetCacheDisabledParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Toggles ignoring cache for each request. If true, cache will not be used.

Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

Source

pub async fn set_cookies( &self, params: SetCookiesParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Sets given cookies.

Source

pub async fn set_extra_http_headers( &self, params: SetExtraHttpHeadersParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Specifies whether to always send extra HTTP headers with the requests from this page.

Source

pub async fn set_attach_debug_stack( &self, params: SetAttachDebugStackParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Specifies whether to attach a page script stack id in requests

Source

pub async fn set_request_interception( &self, params: SetRequestInterceptionParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Sets the requests to intercept that match the provided patterns and optionally resource types. Deprecated, please use Fetch.enable instead.

Source

pub async fn set_user_agent_override( &self, params: SetUserAgentOverrideParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Allows overriding user agent with the given string.

Source

pub async fn stream_resource_content( &self, params: StreamResourceContentParams, session_id: Option<&str>, ) -> Result<StreamResourceContentReturns, CdpError>

Enables streaming of the response for the given requestId. If enabled, the dataReceived event contains the data that was received during streaming.

Source

pub async fn get_security_isolation_status( &self, params: GetSecurityIsolationStatusParams, session_id: Option<&str>, ) -> Result<GetSecurityIsolationStatusReturns, CdpError>

Returns information about the COEP/COOP isolation status.

Source

pub async fn enable_reporting_api( &self, params: EnableReportingApiParams, session_id: Option<&str>, ) -> Result<Value, CdpError>

Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client. Enabling triggers ‘reportingApiReportAdded’ for all existing reports.

Source

pub async fn load_network_resource( &self, params: LoadNetworkResourceParams, session_id: Option<&str>, ) -> Result<LoadNetworkResourceReturns, CdpError>

Fetches the resource and returns the content.

Sets Controls for third-party cookie access Page reload is required before the new cookie behavior will be observed

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more