Skip to content

Instance Method

add(name:value:)

Add a header name/value pair to the block.
mutating func add(name: HTTPHeaders.Name, value: String)

Parameters

name

The header field name. For maximum compatibility this should be an ASCII string. For future-proofing with HTTP/2 lowercase header names are strongly

value

The header field value to add for the given name.

Discussion

This method is strictly additive: if there are other values for the given header name already in the block, this will add a new entry. add performs case-insensitive comparisons on the header field name.