Vapor Documentation Beta

Structure Application.​HTTP.​Client

public struct Client

Member Of

Application.HTTP

Properties

shared

var shared: HTTPClient

configuration

var configuration: HTTPClient.Configuration

Methods

get(_:​headers:​before​Send:​)

public func get(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>

post(_:​headers:​before​Send:​)

public func post(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>

patch(_:​headers:​before​Send:​)

public func patch(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>

put(_:​headers:​before​Send:​)

public func put(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>

delete(_:​headers:​before​Send:​)

public func delete(_ url: URI, headers: HTTPHeaders = [:], beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>

send(_:​headers:​to:​before​Send:​)

public func send(_ method: HTTPMethod, headers: HTTPHeaders = [:], to url: URI, beforeSend: (inout ClientRequest) throws -> () = { _ in }) -> EventLoopFuture<ClientResponse>