Configuration object for Http Requests used by the HttpUtils methods. Allows you to set the URL, verb, headers proxy and credentials that are then passed to the HTTP client.
Westwind.Utilities.HttpClientRequestSettings
public class HttpClientRequestSettings : object
Class Members
Member | Description | |
---|---|---|
Constructor |
||
GetResponseDataAsync |
Returns byte data from the response public Task<Byte[]> GetResponseDataAsync() |
|
GetResponseErrorMessage |
Returns an error message from a JSON error object that contains a message or Message property. public Task |
|
GetResponseJson |
Returns deserialized JSON from the Response public Task |
|
GetResponseStringAsync |
Retrieves the response as a public Task |
|
CapturedRequestContent |
Capture request string data that was actually sent to the server. | |
CapturedResponseContent |
Captured string Response Data from the server | |
Credentials |
Authentication information for this request | |
Encoding |
Content Encoding for the data sent to to server | |
ErrorException |
The full Execption object if an error occurred | |
ErrorMessage |
Error message if one was set | |
HasErrors |
Determines whether the request has errors or didn't return a 200/300 result code | |
HasResponseContent |
||
Headers |
Any Http request headers you want to set for this request | |
HttpVerb |
The HTTP verb to use when sending the request | |
HttpVersion |
Http Protocol Version 1.1 | |
IsRawData |
When true data is not translated. For example when using JSON Request if you want to send raw POST data rather than a serialized object. | |
PreAuthenticate |
Determines whether credentials pre-authenticate | |
Proxy |
An optional proxy to set for this request | |
Request |
||
RequestContent |
The Request content to send to the server. Data can be either string or byte[] type | |
RequestContentType |
The content type of any request data sent to the server in the Data property. | |
Response |
||
ResponseByteData |
Capture binary Response data from the server when using the Data methods rather than string methods. | |
ResponseStatusCode |
The HTTP Status code of the HTTP response | |
ThrowExceptions |
By default (false) throws a Web Exception on 500 and 400 repsonses. This is the default WebClient behavior. | |
Timeout |
The request timeout in milliseconds. 0 for default (20 seconds typically) | |
Url |
The URL to send the request to | |
UserAgent |
The User Agent string sent to the server |
Requirements
Namespace: Westwind.UtilitiesAssembly: westwind.utilities.dll
© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic