Protocols

The following protocols are available globally.

  • When applied to a conforming Restable, and the response from the server results in any Non-2xx HTTP Response, Restivus will publish a Notification Center notification, containing the original request and response.

    See more

    Declaration

    Swift

    public protocol NotificationCenterPublishable
  • When present, Restivus will populate the body of the HTTPURLRequest with the data found in the data property of the Restable request. If a Restable conforms to both PreEncoded and Encodable, Restivus will ignore the Encodable

    See more

    Declaration

    Swift

    public protocol PreEncoded
  • The base protocol for method-specific protocols.

    See more

    Declaration

    Swift

    public protocol Restable
  • Designates the conforming type as a PATCH HTTP Request.

    See more

    Declaration

    Swift

    public protocol Patchable: Restable
  • Designates the conforming type as a GET HTTP Request.

    See more

    Declaration

    Swift

    public protocol Gettable: Restable
  • Provides pre-submission hook which allows a Restable to mutate the HTTPURLRequest. For example, adding a token in a header.

    See more

    Declaration

    Swift

    public protocol Interceptable
  • Designates the conforming type as a POST HTTP Request.

    See more

    Declaration

    Swift

    public protocol Postable: Restable
  • Designates the conforming type as a DELETE HTTP Request.

    See more

    Declaration

    Swift

    public protocol Deletable: Restable
  • Designates the conforming type as a PUT HTTP Request.

    See more

    Declaration

    Swift

    public protocol Puttable: Restable