Class TooManyRequestsResponseBuilder
EmptyResponseBuilder that simulates a 429 - Too Many Requests response.
Implements
Inherited Members
Namespace: Tableau.Migration.Net.Simulation.Responses
Assembly: Tableau.Migration.dll
Syntax
public class TooManyRequestsResponseBuilder : EmptyResponseBuilder, IResponseBuilder
Constructors
TooManyRequestsResponseBuilder(DateTimeOffset?, bool)
Creates a new TooManyRequestsResponseBuilder object.
Declaration
public TooManyRequestsResponseBuilder(DateTimeOffset? retryAfter = null, bool requiresAuthentication = true)
Parameters
Type | Name | Description |
---|---|---|
DateTimeOffset? | retryAfter | A target date to supply for the "Retry-After" header, or null to not include a "Retry-After" header. |
bool | requiresAuthentication | Whether the response requires an authenticated request. |
TooManyRequestsResponseBuilder(TimeSpan?, bool)
Creates a new TooManyRequestsResponseBuilder object.
Declaration
public TooManyRequestsResponseBuilder(TimeSpan? retryAfter = null, bool requiresAuthentication = true)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan? | retryAfter | A time span to supply for the "Retry-After" header, or null to not include a "Retry-After" header. |
bool | requiresAuthentication | Whether the response requires an authenticated request. |
Methods
RespondAsync(HttpRequestMessage, CancellationToken)
Builds a HTTP response for the given request.
Declaration
public override Task<HttpResponseMessage> RespondAsync(HttpRequestMessage request, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | The HTTP request to respond to. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | The HTTP response. |