Platforms to show: All Mac Windows Linux Cross-Platform

NSURLConnectionMBS class   Deprecated

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Networking MBS MacBase Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
This item is deprecated and should no longer be used. You can use NSURLSessionMBS instead.
An NSURLConnection object provides support to perform the loading of a URL request.

The interface for NSURLConnection is sparse, providing only the controls to start and cancel asynchronous loads of a URL request.

NSURLConnection's events allow an object to receive informational callbacks about the asynchronous load of a URL request. Other events provide facilities that allow the subclass to customize the process of performing an asynchronous URL load. These events are called on the thread that started the asynchronous load operation for the associated NSURLConnection object.

NSURLConnection also has a convenience class method, sendSynchronousRequest, to load a URL request synchronously.

The following contract governs the events defined in this class:

  • Zero or more willSendRequest events are called before any further event is called if it is determined that the download must redirect to a new location. The delegate can allow the redirect, modify the destination, or deny the redirect.
  • Zero or more willSendRequestForAuthenticationChallenge events are called before a request for an authentication challenge is sent. The delegate can call the appropriate NSURLAuthenticationChallengeMBS method and perform any other required task related to credentials.
  • Zero or more didReceiveAuthenticationChallenge vents are called if it is necessary to authenticate in order to download the request and the connection does not already have authenticated credentials.
  • Zero or more didCancelAuthenticationChallenge vents are called if the connection cancels the authentication challenge due to the protocol implementation encountering an error.
  • Zero or more didReceiveResponse events are called before receiving a didReceiveData message. The only case where didReceiveResponse is not sent to a delegate is when the protocol implementation encounters an error before a response can be created.
  • Zero or more didReceiveData events are called before any of the following messages are sent to the delegate: willCacheResponse, DidFinishLoading, didFailWithError.
  • Zero or one willCacheResponse events are called to the delegate after didReceiveData is sent but before a DidFinishLoading message is sent.
Unless an NSURLConnection object receives a cancel message, the subclasses receives one and only one of DidFinishLoading, or didFailWithError message, but never both. In addition, once either of these messages is sent, the delegate receives no further messages for the connection.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


The items on this page are in the following plugins: MBS MacBase Plugin.


NSURLConnectionFilterMBS   -   NSURLCredentialMBS


The biggest plugin in space...