Request

open class Request

Responsible for sending a request and receiving the response and associated data from the server, as well as managing its underlying URLSessionTask.

  • A closure executed when monitoring upload or download progress of a request.

    Declaration

    Swift

    public typealias ProgressHandler = (Progress) -> Void
  • Returns a JSON object contained in a result type constructed from the response data using JSONSerialization with the specified reading options.

    Declaration

    Swift

    public static func serializeResponseJSON(
            options: JSONSerialization.ReadingOptions,
            response: HTTPURLResponse?,
            data: Data?,
            error: Error?)
            -> Result<Any>
  • Returns a plist object contained in a result type constructed from the response data using PropertyListSerialization with the specified reading options.

    Declaration

    Swift

    public static func serializeResponsePropertyList(
            options: PropertyListSerialization.ReadOptions,
            response: HTTPURLResponse?,
            data: Data?,
            error: Error?)
            -> Result<Any>
  • The textual representation used when written to an output stream, which includes the HTTP method and URL, as well as the response status code if a response has been received.

    Declaration

    Swift

    open var description: String
  • The textual representation used when written to an output stream, in the form of a cURL command.

    Declaration

    Swift

    open var debugDescription: String
  • Used to represent whether validation was successful or encountered an error resulting in a failure.

    • success: The validation was successful.
    • failure: The validation failed encountering the provided error.

    Declaration

    Swift

    public enum ValidationResult