Create an HTTP field from a name and a value.
init(name: Name, value: String)
s9HTTPTypes9HTTPFieldV4name5valueA2C4NameV_SStcfc
3VW1J
The HTTP field name.
The HTTP field value is initialized from the UTF-8 encoded bytes of the string. Invalid bytes are converted into space characters.
import HTTPTypes
A set of version-independent HTTP currency types.
struct HTTPField
A name-value pair with additional metadata.
struct Name
A case-insensitive but case-preserving ASCII string with an allowed character set defined in RFC 9110.
@frozen struct String
A Unicode string value that is a collection of characters.
init(from decoder: Decoder) throws
init(name: Name, lenientValue: some Collection<UInt8>)
Create an HTTP field from a name and a value. Leniently legalize the value.
init(name: Name, value: some Collection<UInt8>)
static func isValidValue(_ value: String) -> Bool
Whether the string is valid for an HTTP field value based on RFC 9110.
static func isValidValue(_ value: some Collection<UInt8>) -> Bool
Whether the byte collection is valid for an HTTP field value based on RFC 9110.
var description: String { get }
var indexingStrategy: DynamicTableIndexingStrategy
The strategy for whether the field is indexed in the HPACK or QPACK dynamic table.
var name: Name
var playgroundDescription: Any { get }
var value: String { get set }
The HTTP field value as a UTF-8 string.
func encode(to encoder: Encoder) throws
func withUnsafeBytesOfValue<Result>(_ body: (UnsafeBufferPointer<UInt8>) throws -> Result) rethrows -> Result
Runs body over the raw HTTP field value bytes as a contiguous buffer.
body
struct DynamicTableIndexingStrategy