Class HttpService.FastHttpService
- Namespace
- Akavache
- Assembly
- Akavache.dll
Provides a fast-failing HTTP service that reduces retries and timeouts to speed up tests.
public class HttpService.FastHttpService : HttpService, IHttpService
- Inheritance
-
HttpService.FastHttpService
- Implements
- Inherited Members
- Extension Methods
Constructors
FastHttpService(int, TimeSpan?)
Initializes a new instance of the HttpService.FastHttpService class.
public FastHttpService(int retries = 0, TimeSpan? timeout = null)
Parameters
retriesintThe number of retry attempts to use (default is 0).
timeoutTimeSpan?The timeout duration to use (default is 2 seconds).
Methods
MakeWebRequest(Uri, HttpMethod, IEnumerable<KeyValuePair<string, string>>?, string?, int, TimeSpan?)
Makes a web request to the specified URI.
protected override IObservable<HttpResponseMessage> MakeWebRequest(Uri uri, HttpMethod method, IEnumerable<KeyValuePair<string, string>>? headers = null, string? content = null, int retries = 3, TimeSpan? timeout = null)
Parameters
uriUriThe URI to make the request to.
methodHttpMethodThe HTTP method to use for the request.
headersIEnumerable<KeyValuePair<string, string>>Optional HTTP headers to include in the request.
contentstringOptional content to send with the request.
retriesintThe number of retry attempts for failed requests.
timeoutTimeSpan?The timeout duration for the request.
Returns
- IObservable<HttpResponseMessage>
An observable that emits the HTTP response message.