Vapor Documentation Beta

Class Endpoint​Cache

public final class EndpointCache<T> where T: Decodable

Handles the complexities of HTTP caching.

Initializers

init(uri:​)

public init(uri: URI)

The designated initializer.

Parameters

uri URI

The URI of the resource to be downloaded.

Methods

get(on:​logger:​)

public func get(on request: Request, logger: Logger? = nil) -> EventLoopFuture<T>

Downloads the resource.

Parameters

request Request

The Request which is initiating the download.

logger Logger?

An optional logger

get(using:​logger:​on:​)

public func get(using client: Client, logger: Logger? = nil, on eventLoop: EventLoop) -> EventLoopFuture<T>

Downloads the resource.

Parameters

event​Loop Event​Loop

The EventLoop to use for the download.

client Client

The Client which will perform the download.

logger Logger?

An optional logger