Class ClientOptions
httpclient creation options
Inherited Members
Namespace: FastEndpoints.Testing
Assembly: FastEndpoints.Testing.dll
Syntax
public sealed class ClientOptions
Properties
AllowAutoRedirect
gets or sets whether HttpClient instances should automatically follow redirect responses.
the default is true
.
Declaration
public bool AllowAutoRedirect { get; set; }
Property Value
Type | Description |
---|---|
bool |
BaseAddress
gets or sets the base address of HttpClient instances.
the default is http://localhost
.
Declaration
public Uri BaseAddress { get; set; }
Property Value
Type | Description |
---|---|
Uri |
BypassCaching
setting this to true
would cause the outgoing request to contain a 'no-cache' header as well as a randomly generated query parameter,
which would allow test code to bypass both output caching and response caching enforced by the endpoints.
Declaration
public bool BypassCaching { get; set; }
Property Value
Type | Description |
---|---|
bool |
HandleCookies
gets or sets whether HttpClient instances should handle cookies.
the default is true
.
Declaration
public bool HandleCookies { get; set; }
Property Value
Type | Description |
---|---|
bool |
MaxAutomaticRedirections
gets or sets the maximum number of redirect responses that HttpClient instances should follow.
the default is 7
.
Declaration
public int MaxAutomaticRedirections { get; set; }
Property Value
Type | Description |
---|---|
int |
ThrottleBypassHeaderName
setting this value would cause the outgoing request to contain a header with the specified name and a unique value per request, which would allow test
code to bypass the throttling limits enforced by the endpoints. make sure the header name matches with what is configured at the global or endpoint level.
if it's not customized, use the default name X-Forwarded-For
Declaration
public string? ThrottleBypassHeaderName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
AddHandlers(params DelegatingHandler[])
add delegating handlers to the http client
Declaration
public void AddHandlers(params DelegatingHandler[] handlers)
Parameters
Type | Name | Description |
---|---|---|
DelegatingHandler[] | handlers |