Instance Method インスタンスメソッド

addValue(_:forHTTPHeaderField:)

Adds a value to the header field. ある値をヘッダフィールドに加えます。

Declaration 宣言

func addValue(_ value: String, 
forHTTPHeaderField field: String)

Parameters パラメータ

value

The value for the header field. ヘッダフィールドに対する値。

field

The name of the header field. In keeping with the HTTP RFC, HTTP header field names are case insensitive. ヘッダフィールドの名前。HTTP RFCに即して、HTTPヘッダフィールド名はケースを考慮しません。

Discussion 議論

This method provides the ability to add values to header fields incrementally. If a value was previously set for the specified field, the supplied value is appended to the existing value using the appropriate field delimiter (a comma). このメソッドは、値をヘッダフィールドに漸増的に加える能力を提供します。ある値がその指定されたフィールドに対して以前に設定されたならば、この提供された値は既存の値に適切なフィールド区切り子(1つのコンマ)を使って追加されます。

Certain header fields are reserved (see Reserved HTTP Headers). Do not use this method to change such headers. 一定のヘッダフィールドは予約されます(予約されるHTTPヘッダを見てください)。このメソッドをそのようなヘッダを変更するのに使わないでください。

See Also 参照

Accessing Header Fields ヘッダフィールドにアクセスする

Related Documentation 関連文書