Structures

The following structures are available globally.

  • This struct is used to represent a header of HTTP requests. It can contain arbitrarily many fields which are each defined by a key and a value. The key is of the type HttpHeader.Field. The value always needs to be of type String.

    See more

    Declaration

    Swift

    public struct HttpHeader
    extension HttpHeader: Equatable
    extension HttpHeader: Hashable
    extension HttpHeader: ExpressibleByDictionaryLiteral
  • This entity represents a set of HTTP query parameters. Basically, it abstracts a simple mapping from keys (String) to values (String). As a result, an instance of this struct can also be created directly from a [String: Any] dictionary literal where all values are represented in the query parameters by calling String.init(describing:).

    See more

    Declaration

    Swift

    public struct HttpQuery
    extension HttpQuery: ExpressibleByDictionaryLiteral
    extension HttpQuery: Equatable
    extension HttpQuery: Hashable
  • An HTTP route represents a set of URL routing paths. Essentially, a set of routing paths can simply be represented by an array of strings. However, this entity enables initializing HTTP routes without having to explicitly convert all path components to String.

    See more

    Declaration

    Swift

    public struct HttpRoute
    extension HttpRoute: ExpressibleByArrayLiteral
    extension HttpRoute: Equatable
    extension HttpRoute: Hashable
  • This struct can be used to construct requests easily without having to define a custom entity conforming to the Request protocol and defining some HttpService. In a larger application, you should refrain from using this struct, however, it might be useful in small projects and when writing tests.

    This request fixes the result type to Data such that the user can decode to the desired type via calling the decode(type:decoder:) function on the returned Response publisher when scheduling the request.

    As this request struct abstracts away the HttpService in favor for a simpler interface, scheduling can be performed even easier.

    Note that this entity does not allow to make insecure requests over HTTP (only HTTPS).

    See more

    Declaration

    Swift

    public struct AnyRequest : Request
  • This entity may be used to provide retriers independent of the request that has been scheduled. In most cases, this will be the only retrier factory that you are using.

    See more

    Declaration

    Swift

    public struct AnyRetrierFactory : RetrierFactory
  • This retrier is used to indicate that the request is not retried under any circumstances. Upon calling the retry method, the returned Future immediately delivers a message that the request does not need to be retried.

    See more

    Declaration

    Swift

    public struct NilRetrier : Retrier
  • This entity provides a way to initialize an HTTP service without implementing the HttpService protocol in a custom entity. Note that you should usually implement the HttpService protocol instead of simply using an instance of AnyHttpService. This class is mainly used internally.

    See more

    Declaration

    Swift

    public struct AnyHttpService : HttpService
  • This struct simply provides a scope for global “utility” structures that need to be accessible publicly.

    See more

    Declaration

    Swift

    public struct Squid
  • This struct can be used to construct stream requests easily without having to define a custom entity conforming to the StreamRequest protocol and defining some HttpService. The specifics of this entity are very similar to the specifics of AnyRequest. Note, however, that this entity restricts messages being sent and received to be of type String.

    See more

    Declaration

    Swift

    public struct AnyStreamRequest : StreamRequest