Extended StructureHTTPTypes
HTTPFields
extension HTTPFields
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 RangeRepresents the HTTPRangerequest header. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Rangestruct ResponseCompressionA marker header internal to vapor that explicitely allows or disallows response compression.struct WWWAuthenticateRepresents the HTTPWWW-Authenticateheader.
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: CacheControl?Gets the value of theCache-Controlheader, if present.var connection: Connection?var contentDisposition: ContentDisposition?Convenience for accessing the Content-Disposition header.var contentRange: 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.var expires: Expires?Gets the value of theExpiresheader, if present.var forwarded: [Forwarded]Convenience for accessing the Forwarded header. This header is added by proxies to pass information about the original request.var lastModified: LastModified?var links: [Link]?Convenience for accessing the Link header as an array of provided links.var range: Range?Convenience for accessing theRangerequest header.var responseCompression: ResponseCompressionA marker header internal to vapor that explicitly allows or disallows response compression.var setCookie: HTTPCookies?Get and setHTTPCookiesfor an HTTP response.var wwwAuthenticate: WWWAuthenticate?Gets or sets the value of theWWW-Authenticateheader, if present.
Instance Methods
func expirationDate(requestSentAt: Date) -> Date?Determines when the cached data should be expired.func removeHopByHopFields()Removes the fields that belong to a single connection rather than to the message.
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