contentType
Content-Type
static var contentType: `Self` { get }
https://www.rfc-editor.org/rfc/rfc9110.html
Content-Type
static var contentType: `Self` { get }
https://www.rfc-editor.org/rfc/rfc9110.html
import HTTPTypes
A set of version-independent HTTP currency types.
struct Name
A case-insensitive but case-preserving ASCII string with an allowed character set defined in RFC 9110.
struct HTTPField
A name-value pair with additional metadata.
init?(_ name: String)
Create an HTTP field name from a string. Returns nil if the name contains invalid characters defined in RFC 9110.
init(from decoder: Decoder) throws
init?(parsed name: String)
Create an HTTP field name from a string produced by HPACK or QPACK decoders used in modern HTTP versions.
static var accept: `Self` { get }
Accept
static var acceptEncoding: `Self` { get }
Accept-Encoding
static var acceptLanguage: `Self` { get }
Accept-Language
static var acceptRanges: `Self` { get }
Accept-Ranges
static var accessControlAllowCredentials: `Self` { get }
Access-Control-Allow-Credentials
static var accessControlAllowHeaders: `Self` { get }
Access-Control-Allow-Headers
static var accessControlAllowMethods: `Self` { get }
Access-Control-Allow-Methods
static var accessControlAllowOrigin: `Self` { get }
Access-Control-Allow-Origin
static var accessControlExposeHeaders: `Self` { get }
Access-Control-Expose-Headers
static var accessControlMaxAge: `Self` { get }
Access-Control-Max-Age
static var accessControlRequestHeaders: `Self` { get }
Access-Control-Request-Headers
static var accessControlRequestMethod: `Self` { get }
Access-Control-Request-Method
static var age: `Self` { get }
Age
static var allow: `Self` { get }
Allow
static var authenticationInfo: `Self` { get }
Authentication-Info
static var authorization: `Self` { get }
Authorization
static var cacheControl: `Self` { get }
Cache-Control
static var connection: `Self` { get }
Connection
static var contentDisposition: `Self` { get }
Content-Disposition
static var contentEncoding: `Self` { get }
Content-Encoding
static var contentLanguage: `Self` { get }
Content-Language
static var contentLength: `Self` { get }
Content-Length
static var contentLocation: `Self` { get }
Content-Location
static var contentRange: `Self` { get }
Content-Range
static var contentSecurityPolicy: `Self` { get }
Content-Security-Policy
static var contentSecurityPolicyReportOnly: `Self` { get }
Content-Security-Policy-Report-Only
static var cookie: `Self` { get }
Cookie
static var crossOriginResourcePolicy: `Self` { get }
Cross-Origin-Resource-Policy
static var date: `Self` { get }
Date
static var eTag: `Self` { get }
ETag
static var earlyData: `Self` { get }
Early-Data
static var expect: `Self` { get }
Expect
static var expires: `Self` { get }
Expires
static var from: `Self` { get }
From
static var ifMatch: `Self` { get }
If-Match
static var ifModifiedSince: `Self` { get }
If-Modified-Since
static var ifNoneMatch: `Self` { get }
If-None-Match
static var ifRange: `Self` { get }
If-Range
static var ifUnmodifiedSince: `Self` { get }
If-Unmodified-Since
static var lastModified: `Self` { get }
Last-Modified
static var location: `Self` { get }
Location
static var maxForwards: `Self` { get }
Max-Forwards
static var origin: `Self` { get }
Origin
static var priority: `Self` { get }
Priority
static var proxyAuthenticate: `Self` { get }
Proxy-Authenticate
static var proxyAuthenticationInfo: `Self` { get }
Proxy-Authentication-Info
static var proxyAuthorization: `Self` { get }
Proxy-Authorization
static var proxyStatus: `Self` { get }
Proxy-Status
static var range: `Self` { get }
Range
static var referer: `Self` { get }
Referer
static var retryAfter: `Self` { get }
Retry-After
static var secPurpose: `Self` { get }
Sec-Purpose
static var secWebSocketAccept: `Self` { get }
Sec-WebSocket-Accept
static var secWebSocketExtensions: `Self` { get }
Sec-WebSocket-Extensions
static var secWebSocketKey: `Self` { get }
Sec-WebSocket-Key
static var secWebSocketProtocol: `Self` { get }
Sec-WebSocket-Protocol
static var secWebSocketVersion: `Self` { get }
Sec-WebSocket-Version
static var server: `Self` { get }
Server
static var setCookie: `Self` { get }
Set-Cookie
static var strictTransportSecurity: `Self` { get }
Strict-Transport-Security
static var te: `Self` { get }
TE
static var trailer: `Self` { get }
Trailer
static var transferEncoding: `Self` { get }
Transfer-Encoding
static var upgrade: `Self` { get }
Upgrade
static var userAgent: `Self` { get }
User-Agent
static var vary: `Self` { get }
Vary
static var via: `Self` { get }
Via
static var wwwAuthenticate: `Self` { get }
WWW-Authenticate
static var xContentTypeOptions: `Self` { get }
X-Content-Type-Options
let canonicalName: String
The lowercased canonical name of the HTTP field used for hashing and comparison.
var description: String { get }
var playgroundDescription: Any { get }
let rawName: String
The original name of the HTTP field received or supplied to the initializer.
static func == (lhs: HTTPField.Name, rhs: HTTPField.Name) -> Bool
func encode(to encoder: Encoder) throws
func hash(into hasher: inout Hasher)