Class SendingRemoteHttpRequestEventArgs
Provides data for the SendingRemoteHttpRequest event of a HttpCommandExecutor object.
public class SendingRemoteHttpRequestEventArgs : EventArgs
- Inheritance
-
SendingRemoteHttpRequestEventArgs
- Inherited Members
Constructors
SendingRemoteHttpRequestEventArgs(string, string, string?)
Initializes a new instance of the SendingRemoteHttpRequestEventArgs class.
public SendingRemoteHttpRequestEventArgs(string method, string fullUrl, string? requestBody)
Parameters
methodstringThe HTTP method of the request being sent.
fullUrlstringThe full URL of the request being sent.
requestBodystringThe body of the request.
Exceptions
- ArgumentNullException
If
method,fullUrlare null.
Properties
FullUrl
Gets the full URL of the HTTP request.
public string FullUrl { get; }
Property Value
Headers
Gets a read-only dictionary of the headers of the HTTP request. Does not include default headers of the web client making the request.
public IReadOnlyDictionary<string, string> Headers { get; }
Property Value
Method
Gets the HTTP method for the HTTP request.
public string Method { get; }
Property Value
RequestBody
Gets the body of the HTTP request as a string.
public string? RequestBody { get; }
Property Value
Methods
AddHeader(string, string)
Adds a header to the HTTP request.
public void AddHeader(string headerName, string headerValue)
Parameters
Remarks
Adding headers here will attempt to add them to the headers for the HTTP request being sent; however, be aware they may be overwritten by the client raising the event.
Exceptions
- ArgumentException
- ArgumentNullException
If
headerValueis null.