Method
The HTTP request method
struct Method
The HTTP request method
struct Method
import HTTPTypes
A set of version-independent HTTP currency types.
struct HTTPRequest
An HTTP request message consisting of pseudo header fields and header fields.
init(from decoder: Decoder) throws
init(method: Method, scheme: String?, authority: String?, path: String?, headerFields: HTTPFields = [:])
Create an HTTP request with values of pseudo header fields and header fields.
init(parsed fields: [HTTPField]) throws
Create an HTTP request with an array of parsed HTTPField
. The fields must include the necessary request pseudo header fields.
var authority: String? { get set }
A convenient way to access the value of the “:authority” pseudo header field.
var debugDescription: String { get }
var extendedConnectProtocol: String? { get set }
A convenient way to access the value of the “:protocol” pseudo header field.
var headerFields: HTTPFields
The request header fields.
var method: Method { get set }
The HTTP request method.
var path: String? { get set }
A convenient way to access the value of the “:path” pseudo header field.
var pseudoHeaderFields: PseudoHeaderFields
The pseudo header fields.
var scheme: String? { get set }
A convenient way to access the value of the “:scheme” pseudo header field.
func encode(to encoder: Encoder) throws
struct PseudoHeaderFields
The pseudo header fields of a request.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol LosslessStringConvertible : CustomStringConvertible
A type that can be represented as a string in a lossless, unambiguous way.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
protocol Sendable
init?(_ method: String)
Create a request method from a string. Returns nil if the string contains invalid characters defined in RFC 9110.
init?(rawValue: String)
static var connect: `Self` { get }
CONNECT
static var delete: `Self` { get }
DELETE
static var get: `Self` { get }
GET
static var head: `Self` { get }
HEAD
static var options: `Self` { get }
OPTIONS
static var patch: `Self` { get }
PATCH
static var post: `Self` { get }
POST
static var put: `Self` { get }
PUT
static var trace: `Self` { get }
TRACE
var description: String { get }
let rawValue: String
The string value of the request.
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)
import NIOHTTPTypesHTTP1
init(_ oldMethod: HTTPMethod) throws