Instance Method


Retrieves a header value.


func value(forHTTPHeaderField field: String) -> String?



The header field name to use for the lookup (case-insensitive).

Return Value

The value associated with the header field field, or nil if there is no corresponding header field.


Note that, in keeping with the HTTP RFC, HTTP header field names are case-insensitive.

See Also

Accessing Header Fields

var allHTTPHeaderFields: [String : String]?

A dictionary containing all of the HTTP header fields for a request.

func addValue(String, forHTTPHeaderField: String)

Adds a value to the header field.

func setValue(String?, forHTTPHeaderField: String)

Sets a value for the header field.