Headers
public struct Headers
Headers
-
Append values to the header
Parameter
Parameter key: the keyParameter
Parameter value: the valueDeclaration
Swift
public mutating func append(_ key: String, value: String)
Parameters
key
the key
value
the value
-
Conformance to
Collection
Declaration
Swift
public var startIndex: HeadersIndex
-
Conformance to
Collection
Declaration
Swift
public var endIndex: HeadersIndex
-
Conformance to
Collection
Declaration
Swift
public func index(after i: HeadersIndex) -> HeadersIndex
Parameters
i
A valid index of the collection.
i
must be less thanendIndex
.Return Value
The index value immediately after
i
.
-
Sets the location path
Parameter
Parameter path: the pathDeclaration
Swift
public mutating func setLocation(_ path: String)
Parameters
path
the path
-
Sets the Content-Type HTTP header
Parameter
Parameter type: the type to set toParameter
Parameter charset: the charset to specifyDeclaration
Swift
public mutating func setType(_ type: String, charset: String? = nil)
Parameters
type
the type to set to
charset
the charset to specify
-
Sets the Content-Disposition to
attachment
and optionally sets filename parameter in Content-Disposition and Content-TypeParameter
Parameter for: the file to set the filename toDeclaration
Swift
public mutating func addAttachment(for filePath: String? = nil)
Parameters
for
the file to set the filename to
-
Adds a link with specified parameters to Link HTTP header
Parameter
Parameter link: link valueParameter
Parameter linkParameters: the link parameters (according to RFC 5988) with their valuesDeclaration
Swift
public mutating func addLink(_ link: String, linkParameters: [LinkParameter: String])
Parameters
link
link value
linkParameters
the link parameters (according to RFC 5988) with their values