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
request
The request to be (modified and) sent.
interceptors
per request interceptors.
handler
handler that should be called in case of redirect.
Return Value
AnyPublisher
that emits a response asHTTPResponse
-
sendAsync(request:
Asynchronousinterceptors: redirect: ) Send the given request. The request will be processed by the list of
Interceptors
.Note
OnlyHTTPClientError
s are supposed to be thrown.Declaration
Swift
func sendAsync( request: URLRequest, interceptors: [Interceptor], redirect handler: RedirectHandler? ) async throws -> HTTPResponse
Parameters
request
The request to be (modified and) sent.
interceptors
per request interceptors.
handler
handler 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
request
The request to be (modified and) sent.
interceptors
per request interceptors.
Return Value
AnyPublisher
that 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
request
The request to be (modified and) sent.
Return Value
AnyPublisher
that emits a response asHTTPResponse
-
sendAsync(request:
Extension method, asynchronousinterceptors: ) Send the given request. The request will be processed by the list of
Interceptors
.Note
OnlyHTTPClientError
s are supposed to be thrown.Declaration
Swift
public func sendAsync(request: URLRequest, interceptors: [Interceptor]) async throws -> HTTPResponse
Parameters
request
The request to be (modified and) sent.
interceptors
per 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
OnlyHTTPClientError
s are supposed to be thrown.Declaration
Swift
public func sendAsync(request: URLRequest) async throws -> HTTPResponse
Parameters
request
The request to be (modified and) sent.
Return Value
The response as
HTTPResponse