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

set(_:for:task:)

Adds a credential to the credential storage for the specified protection space, on behalf of the specified task. ある資格情報をこの指定された保護空間に対する資格情報ストレージに加えます、指定されたタスクに代わって。

Declaration 宣言

func set(_ credential: URLCredential, 
     for protectionSpace: URLProtectionSpace, 
    task: URLSessionTask)

Parameters パラメータ

credential

The credential to add. If a credential with the same user name already exists in space, then credential replaces the existing object. 追加することになる資格情報。ある資格情報が同じユーザ名で既にspaceの中に存在するならば、そのときcredentialは既存のオブジェクトに取って代わります。

protectionSpace

The protection space to which to add the credential. それに対して資格情報を加えることになる保護空間。

task

The task accessing the specified protection space. Subclasses of URLCredentialStorage may use the request URL or other properties of this task to affect how the default credential is stored. 指定された保護空間にアクセスしているタスク。URLCredentialStorageのサブクラスは、このタスクのリクエストURLまたは他のプロパティを使って、どのように省略時の資格情報が格納されるか影響を与えるかもしれません。

See Also 参照

Adding and Removing Credentials 資格情報の追加と除去