Table of Contents

Class ResponseCache

Namespace
TypedRest.Http
Assembly
TypedRest.dll

Captures the content of an HttpResponseMessage for caching.

public sealed class ResponseCache
Inheritance
ResponseCache
Inherited Members

Properties

IsExpired

Indicates whether this cached response has expired.

public bool IsExpired { get; }

Property Value

bool

Methods

From(HttpResponseMessage)

Creates a ResponseCache from a response if it is eligible for caching.

public static ResponseCache? From(HttpResponseMessage response)

Parameters

response HttpResponseMessage

Returns

ResponseCache

The ResponseCache; null if the response is not eligible for caching.

GetContent()

Returns a copy of the cached HttpContent.

public HttpContent GetContent()

Returns

HttpContent

SetIfModifiedHeaders(HttpRequestHeaders)

Sets request headers that require that the resource has been modified since it was cached.

public void SetIfModifiedHeaders(HttpRequestHeaders headers)

Parameters

headers HttpRequestHeaders

SetIfUnmodifiedHeaders(HttpRequestHeaders)

Sets request headers that require that the resource has not been modified since it was cached.

public void SetIfUnmodifiedHeaders(HttpRequestHeaders headers)

Parameters

headers HttpRequestHeaders