Class ResponseCache
Captures the content of an HttpResponseMessage for caching.
Namespace: TypedRest.Http
Assembly: TypedRest.dll
Syntax
public class ResponseCache : Object
Properties
IsExpired
Indicates whether this cached response has expired.
Declaration
public bool IsExpired { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
From(HttpResponseMessage)
Creates a ResponseCache from a response
if it is eligible for caching.
Declaration
public static ResponseCache From(HttpResponseMessage response)
Parameters
Type | Name | Description |
---|---|---|
HttpResponseMessage | response |
Returns
Type | Description |
---|---|
ResponseCache | The ResponseCache; |
GetContent()
Returns the cached HttpClient.
Declaration
public HttpContent GetContent()
Returns
Type | Description |
---|---|
HttpContent |
SetIfModifiedHeaders(HttpRequestHeaders)
Sets request headers that require that the resource has been modified since it was cached.
Declaration
public void SetIfModifiedHeaders(HttpRequestHeaders headers)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestHeaders | headers |
SetIfUnmodifiedHeaders(HttpRequestHeaders)
Sets request headers that require that the resource has not been modified since it was cached.
Declaration
public void SetIfUnmodifiedHeaders(HttpRequestHeaders headers)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestHeaders | headers |