Structures

The following structures are available globally.

  • Use an Array of Interceptor as a single Interceptor

    See more

    Declaration

    Swift

    public struct CompositeInterceptor : ExpressibleByArrayLiteral, Sequence
    extension CompositeInterceptor: Interceptor
  • Constructs multipart/form-data for uploads within an HTTP or HTTPS body. We encode the data directly in memory. It’s very efficient, but can lead to memory issues if the dataset is too large (eg: a Video)

    Warning: A Second approch to encode bigger dataset will be addes later

    See more

    Declaration

    Swift

    public struct MultipartFormData
  • A path represents a path a request can query to

    You can create paths using plain String, for instance:

    extension Path {
      static let user = "v1/users"
    }
    
    If you want to regroup a set of paths you can use your own "namespace" and add a forward declaration in `Path`.
    Adding a declaration provide autocompletion when using it in `Request`.
    ```swift
    enum MyPaths {
      static let user: Path = "v1/users"
    }
    
    extension Path {
      static let myPaths = MyPaths.self
    }
    
    let user: Path = .myPaths.user
    
    See more

    Declaration

    Swift

    public struct Path : Equatable, ExpressibleByStringLiteral, ExpressibleByStringInterpolation
  • A HTTP request safely typed for an Output response

    Highly inspired by https://swiftwithmajid.com/2021/02/10/building-type-safe-networking-in-swift/

    See more

    Declaration

    Swift

    public struct Request<Output>
  • Declaration

    Swift

    public struct URLDataResponse
  • a type defining some parameters for a Session

    See more

    Declaration

    Swift

    public struct SessionConfiguration