Class Network
Class providing functionality for manipulating network calls using DevTools Protocol commands
public abstract class Network
- Inheritance
-
Network
- Derived
- Inherited Members
Methods
AddResponseBody(HttpResponseData)
Asynchronously adds the response body to the provided HttpResponseData object.
public abstract Task AddResponseBody(HttpResponseData responseData)
Parameters
responseDataHttpResponseDataThe HttpResponseData object to which to add the response body.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
responseDatais null.
CancelAuth(string)
Asynchronously cancels authorization of an intercepted network request.
public abstract Task CancelAuth(string requestId)
Parameters
requestIdstringThe ID of the network request for which to cancel authentication.
Returns
- Task
A task that represents the asynchronous operation.
ContinueRequest(HttpRequestData)
Asynchronously continues an intercepted network request.
public abstract Task ContinueRequest(HttpRequestData requestData)
Parameters
requestDataHttpRequestDataThe HttpRequestData of the request.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
requestDatais null.
ContinueRequestWithResponse(HttpRequestData, HttpResponseData)
Asynchronously continues an intercepted network request and returns the specified response.
public abstract Task ContinueRequestWithResponse(HttpRequestData requestData, HttpResponseData responseData)
Parameters
requestDataHttpRequestDataThe HttpRequestData of the request.
responseDataHttpResponseDataThe HttpResponseData with which to respond to the request
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
requestDataorresponseDataare null.
ContinueRequestWithoutModification(HttpRequestData)
Asynchronously continues an intercepted network request without modification.
public abstract Task ContinueRequestWithoutModification(HttpRequestData requestData)
Parameters
requestDataHttpRequestDataThe HttpRequestData of the network request.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
requestDatais null.
ContinueResponseWithoutModification(HttpResponseData)
Asynchronously continues an intercepted network response without modification.
public abstract Task ContinueResponseWithoutModification(HttpResponseData responseData)
Parameters
responseDataHttpResponseDataThe HttpResponseData of the network response.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
responseDatais null.
ContinueWithAuth(string, string?, string?)
Asynchronously continues an intercepted network call using authentication.
public abstract Task ContinueWithAuth(string requestId, string? userName, string? password)
Parameters
requestIdstringThe ID of the network request for which to continue with authentication.
userNamestringThe user name with which to authenticate.
passwordstringThe password with which to authenticate.
Returns
- Task
A task that represents the asynchronous operation.
DisableFetch()
Asynchronously disables the fetch domain.
public abstract Task DisableFetch()
Returns
- Task
A task that represents the asynchronous operation.
DisableNetwork()
Asynchronously disables the fetch domain.
public abstract Task DisableNetwork()
Returns
- Task
A task that represents the asynchronous operation.
DisableNetworkCaching()
Asynchronously disables network caching.
public abstract Task DisableNetworkCaching()
Returns
- Task
A task that represents the asynchronous operation.
EnableFetchForAllPatterns()
Asynchronously enables the fetch domain for all URL patterns.
public abstract Task EnableFetchForAllPatterns()
Returns
- Task
A task that represents the asynchronous operation.
EnableNetwork()
Asynchronously enables the network domain.
public abstract Task EnableNetwork()
Returns
- Task
A task that represents the asynchronous operation.
EnableNetworkCaching()
Asynchronously enables network caching.
public abstract Task EnableNetworkCaching()
Returns
- Task
A task that represents the asynchronous operation.
OnAuthRequired(AuthRequiredEventArgs)
Raises the AuthRequired event.
protected virtual void OnAuthRequired(AuthRequiredEventArgs e)
Parameters
eAuthRequiredEventArgsAn AuthRequiredEventArgs that contains the event data.
OnRequestPaused(RequestPausedEventArgs)
Raises the RequestPaused event.
protected virtual void OnRequestPaused(RequestPausedEventArgs e)
Parameters
eRequestPausedEventArgsAn RequestPausedEventArgs that contains the event data.
OnResponsePaused(ResponsePausedEventArgs)
Raises the ResponseReceived event.
protected virtual void OnResponsePaused(ResponsePausedEventArgs e)
Parameters
eResponsePausedEventArgsAn ResponsePausedEventArgs that contains the event data.
SetUserAgentOverride(UserAgent)
Asynchronously sets the override of the user agent settings.
public abstract Task SetUserAgentOverride(UserAgent userAgent)
Parameters
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- ArgumentNullException
If
userAgentis null.
SetUserAgentOverride(string)
Asynchronously sets the override of the user agent string.
public Task SetUserAgentOverride(string userAgent)
Parameters
userAgentstringThe user agent string to set.
Returns
- Task
A task that represents the asynchronous operation.
Events
AuthRequired
Occurs when a network request requires authorization.
public event Network.AsyncEventHandler<AuthRequiredEventArgs>? AuthRequired
Event Type
RequestPaused
Occurs when a network request is intercepted.
public event Network.AsyncEventHandler<RequestPausedEventArgs>? RequestPaused
Event Type
ResponsePaused
Occurs when a network response is received.
public event Network.AsyncEventHandler<ResponsePausedEventArgs>? ResponsePaused