Type Method 型メソッド

cookies(withResponseHeaderFields:for:)

Creates an array of HTTP cookies that corresponds to the provided response header fields for the provided URL. 提供されたURLに対する提供されたレスポンスヘッダフィールドに対応するHTTPクッキーからなるある配列を作成します。

Declaration 宣言

class func cookies(withResponseHeaderFields headerFields: [String : String], 
               for URL: URL) -> [HTTPCookie]

Parameters パラメータ

headerFields

The header fields used to create the HTTPCookie objects. HTTPCookieオブジェクトを作成するのに使われるヘッダフィールド。

URL

The URL associated with the created cookies. 作成されたクッキーと結び付けられるURL。

Return Value 戻り値

The array of created cookies. 作成されたクッキーからなる配列。

Discussion 議論

This method ignores irrelevant header fields in headerFields, allowing dictionaries to contain additional data. このメソッドは、headerFieldsにおいて無関係なヘッダフィールドを無視して、辞書が追加的なデータを含むことを可能にします。

If headerFields doesn’t specify a domain for a given cookie, the cookie is created with a default domain value of URL. headerFieldsがドメインをある与えられたクッキーに対して指定しないならば、クッキーは省略時のドメイン値のURLを使って作成されます。

If headerFields doesn’t specify a path for a given cookie, the cookie is created with a default path value of "/". headerFieldsがパスをある与えられたクッキーに指定しないならば、クッキーは省略時のパス値の"/"を使って作成されます。

See Also 参照

Creating Cookies クッキーを作成する