HTTPMethod

public struct HTTPMethod : RawRepresentable, Equatable, Hashable, Sendable

Type representing HTTP methods. Raw String value is stored and compared case-sensitively, so HTTPMethod.get != HTTPMethod(rawValue: "get").

See https://tools.ietf.org/html/rfc7231#section-4.3

  • CONNECT method.

    Declaration

    Swift

    public static let connect: HTTPMethod
  • DELETE method.

    Declaration

    Swift

    public static let delete: HTTPMethod
  • get

    GET method.

    Declaration

    Swift

    public static let get: HTTPMethod
  • HEAD method.

    Declaration

    Swift

    public static let head: HTTPMethod
  • OPTIONS method.

    Declaration

    Swift

    public static let options: HTTPMethod
  • PATCH method.

    Declaration

    Swift

    public static let patch: HTTPMethod
  • POST method.

    Declaration

    Swift

    public static let post: HTTPMethod
  • put

    PUT method.

    Declaration

    Swift

    public static let put: HTTPMethod
  • QUERY method.

    Declaration

    Swift

    public static let query: HTTPMethod
  • TRACE method.

    Declaration

    Swift

    public static let trace: HTTPMethod
  • Declaration

    Swift

    public let rawValue: String
  • Declaration

    Swift

    public init(rawValue: String)