Struct ServiceHttpClientOptions
A class to configure options for a IServiceHttpClient
Inherited Members
Namespace: Unity.Cloud.Common
Syntax
public struct ServiceHttpClientOptions
Constructors
ServiceHttpClientOptions(Boolean, Boolean, Boolean, Boolean, String, IRetryPolicy)
Initializes and returns an instance of ServiceHttpClientOptions.
Declaration
public ServiceHttpClientOptions(bool skipDefaultAuthentication, bool skipDefaultHeaders, bool skipErrorProcessing, bool useBaseHttpClientOnly, string downloadFilePath = null, IRetryPolicy retryPolicy = null)
Parameters
Type | Name | Description |
---|---|---|
Boolean | skipDefaultAuthentication | Whether to skip the default authentication flow. |
Boolean | skipDefaultHeaders | Whether to fill the default headers. |
Boolean | skipErrorProcessing | Whether to skip error processing. |
Boolean | useBaseHttpClientOnly | Whether to use the base HTTP client to send requests. |
String | downloadFilePath | The path for file downloads. |
IRetryPolicy | retryPolicy | The retry policy to use for the client. |
Properties
DownloadFilePath
The path for file downloads.
Declaration
public readonly string DownloadFilePath { get; }
Property Value
Type | Description |
---|---|
String |
RetryPolicy
The IRetryPolicy to be used by the client.
Declaration
public readonly IRetryPolicy RetryPolicy { get; }
Property Value
Type | Description |
---|---|
IRetryPolicy |
SkipDefaultAuthentication
Whether to skip the default authentication flow.
Declaration
public readonly bool SkipDefaultAuthentication { get; }
Property Value
Type | Description |
---|---|
Boolean |
SkipDefaultHeaders
Whether to fill the default headers.
Declaration
public readonly bool SkipDefaultHeaders { get; }
Property Value
Type | Description |
---|---|
Boolean |
SkipErrorProcessing
Whether to skip error processing.
Declaration
public readonly bool SkipErrorProcessing { get; }
Property Value
Type | Description |
---|---|
Boolean |
UseBaseHttpClientOnly
Whether to use the base IHttpClient to send requests.
Declaration
public readonly bool UseBaseHttpClientOnly { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
Default()
Initializes and returns an instance of ServiceHttpClientOptions with default settings.
Declaration
public static ServiceHttpClientOptions Default()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
DownloadFilePathNoRetryOption(String)
Initializes and returns an instance of ServiceHttpClientOptions with file download options and no retry policy.
Declaration
public static ServiceHttpClientOptions DownloadFilePathNoRetryOption(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path |
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
DownloadFilePathOption(String)
Initializes and returns an instance of ServiceHttpClientOptions with file download options.
Declaration
public static ServiceHttpClientOptions DownloadFilePathOption(string path)
Parameters
Type | Name | Description |
---|---|---|
String | path |
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
NoRetryOption()
Initializes and returns an instance of ServiceHttpClientOptions with no retry policy.
Declaration
public static ServiceHttpClientOptions NoRetryOption()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
SkipDefaultAuthenticationOption()
Initializes and returns an instance of ServiceHttpClientOptions which skips default authentication.
Declaration
public static ServiceHttpClientOptions SkipDefaultAuthenticationOption()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
SkipDefaultHeadersOption()
Initializes and returns an instance of ServiceHttpClientOptions which skips adding default headers.
Declaration
public static ServiceHttpClientOptions SkipDefaultHeadersOption()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
SkipErrorProcessingOption()
Initializes and returns an instance of ServiceHttpClientOptions which skips error processing.
Declaration
public static ServiceHttpClientOptions SkipErrorProcessingOption()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |
UseBaseHttpClientOnlyOption()
Initializes and returns an instance of ServiceHttpClientOptions which uses the base IHttpClient.
Declaration
public static ServiceHttpClientOptions UseBaseHttpClientOnlyOption()
Returns
Type | Description |
---|---|
ServiceHttpClientOptions | The specific client options. |