setDefaultCredential(_:for:task:)
Sets the default credential for a given protection space, which is being accessed by the given task.
Declaration
func setDefaultCredential(_ credential: URLCredential, for protectionSpace: URLProtectionSpace, task: URLSessionTask)Parameters
- credential:
The URL credential to set as the default for the protection space. If the receiver does not contain
credentialin the specified protection space it will be added. - protectionSpace:
The protection space whose default credential is being set.
- 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.