HTTPMethod

public struct HTTPMethod : Hashable, RawRepresentable

A method (AKA verb) to be sent in a HTTP request. The standard (HTTP/1.1) headers are implemented as static properties. New methods can be added in an extension on the HTTPMethod type.

Pattern Matching

HTTPMethod provides an overload of the ~= operator so methods can easily be pattern matched on in a switch statement.

  • Declaration

    Swift

    public let rawValue: String
  • Declaration

    Swift

    public init(rawValue: String)
  • Undocumented

    Declaration

    Swift

    static func ~= (pattern: HTTPMethod, value: HTTPMethod) -> Bool
  • Undocumented

    Declaration

    Swift

    static let connect: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let delete: HTTPMethod
  • get

    Undocumented

    Declaration

    Swift

    static let get: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let head: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let options: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let patch: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let post: HTTPMethod
  • put

    Undocumented

    Declaration

    Swift

    static let put: HTTPMethod
  • Undocumented

    Declaration

    Swift

    static let trace: HTTPMethod