APIAuthorization

public protocol APIAuthorization

APIAuthorization defines all the properties and methods a class must contain to be used as an authorization for an APIRequest.

  • parametersFor(request:) Default implementation

    Configuration point for an APIAuthorization to inject additional parameters into a request.

    Default Implementation

    Placeholder implementation, returns nil.

    Declaration

    Swift

    func parametersFor<ReturnType>(request: APIRequest<ReturnType>) -> HTTPParameters? where ReturnType : APIReturnable
  • bodyFor(request:) Default implementation

    Configuration point for an APIAuthorization to inject additional body components into a request.

    Default Implementation

    Placeholder implementation, returns nil.

    Declaration

    Swift

    func bodyFor<ReturnType>(request: APIRequest<ReturnType>) -> HTTPBody? where ReturnType : APIReturnable
  • headersFor(request:) Default implementation

    Configuration point for an APIAuthorization to inject additional headers into a request.

    Default Implementation

    Placeholder implementation, returns nil.

    Declaration

    Swift

    func headersFor<ReturnType>(request: APIRequest<ReturnType>) -> HTTPHeaders? where ReturnType : APIReturnable