Table of Contents

Class HttpResponseHeadersExtensions

Namespace
Kampute.HttpClient
Assembly
Kampute.HttpClient.dll

Provides extension methods for HttpResponseHeaders to facilitate HTTP response processing.

public static class HttpResponseHeadersExtensions
Inheritance
HttpResponseHeadersExtensions
Inherited Members

Methods

TryExtractRateLimitResetTime(HttpResponseHeaders, out DateTimeOffset?)

Attempts to extract the rate limit reset time from the HTTP response headers.

public static bool TryExtractRateLimitResetTime(this HttpResponseHeaders headers, out DateTimeOffset? resetTime)

Parameters

headers HttpResponseHeaders

The HTTP response headers.

resetTime DateTimeOffset?

When this method returns, contains the extracted time if the operation is successful; otherwise, null. This parameter is passed uninitialized.

Returns

bool

true if the time could be successfully extracted and parsed; otherwise, false.

TryExtractRetryAfterTime(HttpResponseHeaders, out DateTimeOffset?)

Attempts to extract the retry-after time from the HTTP response headers.

public static bool TryExtractRetryAfterTime(this HttpResponseHeaders headers, out DateTimeOffset? retryAfterTime)

Parameters

headers HttpResponseHeaders

The HTTP response headers.

retryAfterTime DateTimeOffset?

When this method returns, contains the extracted time if the operation is successful; otherwise, null. This parameter is passed uninitialized.

Returns

bool

true if the time could be successfully extracted and parsed; otherwise, false.