Protocols

The following protocols are available globally.

  • A Requestable is an interfaces for types that express the details of an HTTP request

    Types that conform to Requestable can be used as a paramater in RequestManager‘s makeRequest method, to create an observable combine publisher. Requestable is a generic procol that requires to you specify the request body, respose body, and error model.

    Depending on what types you use to specialize the protocol, parts of the interface maybe already implemented for you. See the documentation on each protocol requirement for more information.

    See more

    Declaration

    Swift

    public protocol Requestable
  • A protocol for types that can be expressed as Data

    See more

    Declaration

    Swift

    public protocol AutomaticBodyEncoding
  • A protocol for types that can be initialized from Data provided by a network response

    See more

    Declaration

    Swift

    public protocol AutomaticBodyDecoding
  • A Requestable with basic HTTP status code based response validation

    Declaration

    Swift

    public protocol HTTPRequest : Requestable where Self.ResponseError == HTTPError
  • A Requestable with no validation – all completed requests will be considered safe regardless of status code, headers, or body

    Declaration

    Swift

    public protocol Request : Requestable where Self.ResponseError == NoError