Instance Method

setDefaultCredential:forProtectionSpace:task:

Sets the default credential for a given protection space, which is being accessed by the given task.

Declaration

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

Parameters

credential

The URL credential to set as the default for the protection space. If the receiver does not contain credential in 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 NSURLCredentialStorage may use the request URL or other properties of this task to affect how the default credential is stored.

See Also

Getting and Setting Default Credentials

- defaultCredentialForProtectionSpace:

Returns the default credential for the specified protection space.

- getDefaultCredentialForProtectionSpace:task:completionHandler:

Gets the default credential for the specified protection space, which is being accessed by the given task, and passes it to the provided completion handler.

- setDefaultCredential:forProtectionSpace:

Sets the default credential for a specified protection space.