Headers

public struct Headers

Headers

  • Append values to the header

    Parameter

    Parameter key: the key

    Parameter

    Parameter value: the value

    Declaration

    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 than endIndex.

    Return Value

    The index value immediately after i.

  • Sets the location path

    Parameter

    Parameter path: the path

    Declaration

    Swift

    public mutating func setLocation(_ path: String)

    Parameters

    path

    the path

  • Sets the Content-Type HTTP header

    Parameter

    Parameter type: the type to set to

    Parameter

    Parameter charset: the charset to specify

    Declaration

    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-Type

    Parameter

    Parameter for: the file to set the filename to

    Declaration

    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 value

    Parameter

    Parameter linkParameters: the link parameters (according to RFC 5988) with their values

    Declaration

    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