Extended Structure
HTTPHeaders
extension HTTPHeaders
Topics
Structures
struct CacheControlRepresents the HTTPCache-Controlheader.struct Connectionstruct ContentDispositionstruct ContentRangeRepresents the HTTPContent-Rangeresponse header.struct Expiresstruct ForwardedParses theForwardedheader.struct LastModifiedRepresents the HTTPLast-Modifiedheader.struct Linkstruct NameType used for the name of a HTTP header in theHTTPHeadersstorage.struct RangeRepresents the HTTPRangerequest header. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Rangestruct ResponseCompressionA marker header internal to vapor that explicitly allows or disallows response compression.
Instance Properties
var accept: [HTTPMediaTypePreference]Returns a collection ofMediaTypePreferences specified by this HTTP message’s"Accept"header.var basicAuthorization: BasicAuthorization?Access or set theAuthorization: Basic: ...header.var bearerAuthorization: BearerAuthorization?Access or set theAuthorization: Bearer: ...header.var cacheControl: HTTPHeaders.CacheControl?Gets the value of theCache-Controlheader, if present.var connection: HTTPHeaders.Connection?var contentDisposition: HTTPHeaders.ContentDisposition?Convenience for accessing the Content-Disposition header.var contentRange: HTTPHeaders.ContentRange?Convenience for accessing the Content-Range response header.var contentType: HTTPMediaType?MediaTypespecified by this message’s"Content-Type"header.var cookie: HTTPCookies?Get and setHTTPCookiesfor an HTTP request This accesses the"Cookie"header.var expires: HTTPHeaders.Expires?Gets the value of theExpiresheader, if present.var forwarded: [HTTPHeaders.Forwarded]Convenience for accessing the Forwarded header. This header is added by proxies to pass information about the original request.var lastModified: HTTPHeaders.LastModified?var links: [HTTPHeaders.Link]?Convenience for accessing the Link header as an array of provided links.var range: HTTPHeaders.Range?Convenience for accessing theRangerequest header.var responseCompression: HTTPHeaders.ResponseCompressionA marker header internal to vapor that explicitly allows or disallows response compression.var setCookie: HTTPCookies?Get and setHTTPCookiesfor an HTTP response This accesses the"Set-Cookie"header.
Instance Methods
func add(name: HTTPHeaders.Name, value: String)Add a header name/value pair to the block.func contains(name: HTTPHeaders.Name) -> BoolReturnstrueif theHTTPHeaderscontains a value for the supplied name.func expirationDate(requestSentAt: Date) -> Date?Determines when the cached data should be expired.func first(name: HTTPHeaders.Name) -> String?Returns the first header value with the supplied name.func remove(name: HTTPHeaders.Name)Remove all values for a given header name from the block.func replaceOrAdd(name: HTTPHeaders.Name, value: String)Add a header name/value pair to the block, replacing any previous values for the same header name that are already in the block.
Subscripts
subscript(HTTPHeaders.Name) -> [String]Retrieve all of the values for a given header field name from the block.subscript(canonicalForm _: HTTPHeaders.Name) -> [Substring]
Enumerations
enum RangeUnitThe unit in whichContentRanges andRanges are specified. This is usuallybytes. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range
Default Implementations
Relationships
Conforms To
Swift.CopyableSwift.CustomDebugStringConvertibleSwift.DecodableSwift.EncodableSwift.Escapable