Instance Method

setCredential:forProtectionSpace:task:

Adds a credential to the credential storage for the specified protection space, on behalf of the specified task.

Declaration

- (void)setCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)protectionSpace task:(NSURLSessionTask *)task;

Parameters

credential

The credential to add. If a credential with the same user name already exists in space, then credential replaces the existing object.

protectionSpace

The protection space to which to add the credential.

task

The task accessing the specified protection space. Subclasses of NSURLCredentialStorage may use the request URL or other properties of this task to affect how the default credential is stored.

See Also

Adding and Removing Credentials

- removeCredential:forProtectionSpace:

Removes the specified credential from the credential storage for the specified protection space.

- removeCredential:forProtectionSpace:options:

Removes the specified credential from the credential storage for the specified protection space using the given options.

- removeCredential:forProtectionSpace:options:task:

Removes the specified credential from the credential storage for the specified protection space, on behalf of the given task and using the given options.

- setCredential:forProtectionSpace:

Adds a credential to the credential storage for the specified protection space.