HTTPClient
public protocol HTTPClient
Protocol HTTPClient
-
Send the given request. The request will be processed by the list of
Interceptors.Declaration
Swift
@available(*, deprecated, message: "Use async version instead") func sendPublisher(request: URLRequest, interceptors: [Interceptor], redirect handler: RedirectHandler?) -> AnyPublisher<HTTPResponse, HTTPClientError>Parameters
requestThe request to be (modified and) sent.
interceptorsper request interceptors.
handlerhandler that should be called in case of redirect.
Return Value
AnyPublisherthat emits a response asHTTPResponse -
sendAsync(request:Asynchronousinterceptors: redirect: ) Send the given request. The request will be processed by the list of
Interceptors.Note
OnlyHTTPClientErrors are supposed to be thrown.Declaration
Swift
func sendAsync( request: URLRequest, interceptors: [Interceptor], redirect handler: RedirectHandler? ) async throws -> HTTPResponseParameters
requestThe request to be (modified and) sent.
interceptorsper request interceptors.
handlerhandler that should be called in case of redirect.
Return Value
The response as
HTTPResponse -
List of all active interceptors of the HTTP client.
Declaration
Swift
var interceptors: [Interceptor] { get } -
sendPublisher(request:Extension methodinterceptors: ) Send the given request. The request will be processed by the list of
Interceptors.Declaration
Swift
@available(*, deprecated, message: "Use async version instead") public func sendPublisher(request: URLRequest, interceptors: [Interceptor]) -> AnyPublisher<HTTPResponse, HTTPClientError>Parameters
requestThe request to be (modified and) sent.
interceptorsper request interceptors.
Return Value
AnyPublisherthat emits a response asHTTPResponse -
sendPublisher(request:Extension method) Send the given request.
Declaration
Swift
@available(*, deprecated, message: "Use async version instead") public func sendPublisher(request: URLRequest) -> AnyPublisher<HTTPResponse, HTTPClientError>Parameters
requestThe request to be (modified and) sent.
Return Value
AnyPublisherthat emits a response asHTTPResponse -
sendAsync(request:Extension method, asynchronousinterceptors: ) Send the given request. The request will be processed by the list of
Interceptors.Note
OnlyHTTPClientErrors are supposed to be thrown.Declaration
Swift
public func sendAsync(request: URLRequest, interceptors: [Interceptor]) async throws -> HTTPResponseParameters
requestThe request to be (modified and) sent.
interceptorsper request interceptors.
Return Value
The response as
HTTPResponse -
sendAsync(request:Extension method, asynchronous) Send the given request. The request will be processed by the list of
Interceptors.Note
OnlyHTTPClientErrors are supposed to be thrown.Declaration
Swift
public func sendAsync(request: URLRequest) async throws -> HTTPResponseParameters
requestThe request to be (modified and) sent.
Return Value
The response as
HTTPResponse
View on GitHub
HTTPClient Protocol Reference