HttpResponseHeadersExtensions Class

Namespace
Kampute.HttpClient
Assembly
  • Kampute.HttpClient.dll

Definition

Provides extension methods for HttpResponseHeaders to facilitate HTTP response processing.
public static class HttpResponseHeadersExtensions
Inheritance
  • object
  • HttpResponseHeadersExtensions

Methods

TryExtractRateLimitResetTime(this HttpResponseHeaders, out Nullable<DateTimeOffset>)

Attempts to extract the rate limit reset time from the HTTP response headers.
public static bool TryExtractRateLimitResetTime(this HttpResponseHeaders headers, out Nullable<DateTimeOffset> resetTime)

Parameters

headers HttpResponseHeaders
The HTTP response headers.
resetTime Nullable<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(this HttpResponseHeaders, out Nullable<DateTimeOffset>)

Attempts to extract the retry-after time from the HTTP response headers.
public static bool TryExtractRetryAfterTime(this HttpResponseHeaders headers, out Nullable<DateTimeOffset> retryAfterTime)

Parameters

headers HttpResponseHeaders
The HTTP response headers.
retryAfterTime Nullable<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.