HTTPClient

public protocol HTTPClient

Protocol HTTPClient

  • Send the given request. The request will be processed by the list of Interceptors.

    Declaration

    Swift

    func send(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 as HTTPResponse

  • List of all active interceptors of the HTTP client.

    Declaration

    Swift

    var interceptors: [Interceptor] { get }
  • send(request:interceptors:) Extension method

    Send the given request. The request will be processed by the list of Interceptors.

    Declaration

    Swift

    public func send(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 as HTTPResponse

  • send(request:) Extension method

    Send the given request.

    Declaration

    Swift

    public func send(request: URLRequest) -> AnyPublisher<HTTPResponse, HTTPClientError>

    Parameters

    request

    The request to be (modified and) sent.

    Return Value

    AnyPublisher that emits a response as HTTPResponse