Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLSessionMBS class.

NSURLSessionMBS.dataTaskWithRequest(request as NSURLRequestMBS) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a task that retrieves the contents of a URL based on the specified URL request object.

request: A URL request object that provides request-specific information such as the URL, cache policy, request type, and body data or body stream.

Returns he new session data task.

By creating a task based on a request object, you can tune various aspects of the task’s behavior, including the cache policy and timeout interval.
After you create the task, you must start it by calling its resume method.

See also:

NSURLSessionMBS.dataTaskWithRequest(request as NSURLRequestMBS, handler as NSURLSessionDataTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a task that retrieves the contents of a URL based on the specified URL request object, and calls a handler upon completion.

request: A URL request object that provides the URL, cache policy, request type, body data or body stream, and so on.
completionHandler: The completion handler to call when the load request is complete.

See also:

NSURLSessionMBS.dataTaskWithURL(URL as String) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a task that retrieves the contents of the specified URL.

URL: The URL to be retrieved.

After you create the task, you must start it by calling its resume method. The task calls methods on the session’s delegate to provide you with the response metadata, response data, and so on.

See also:

NSURLSessionMBS.dataTaskWithURL(URL as String, handler as NSURLSessionDataTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a task that retrieves the contents of the specified URL, then calls a handler upon completion.

url: The URL to be retrieved.
handler: The completion handler to call when the load request is complete.

See also:

NSURLSessionMBS.downloadTaskWithRequest(request as NSURLRequestMBS) as NSURLSessionDownloadTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task that retrieves the contents of a URL based on the specified URL request object and saves the results to a file.

request: A URL request object that provides the URL, cache policy, request type, body data or body stream, and so on.

Returns the new session download task.

By creating a task based on a request object, you can tune various aspects of the task’s behavior, including the cache policy and timeout interval.
After you create the task, you must start it by calling its resume method. The task calls methods on the session’s delegate to provide you with progress notifications, the location of the resulting temporary file, and so on.

See also:

NSURLSessionMBS.downloadTaskWithRequest(request as NSURLRequestMBS, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task that retrieves the contents of a URL based on the specified URL request object, saves the results to a file, and calls a handler upon completion.

request: A URL request object that provides the URL, cache policy, request type, body data or body stream, and so on.
Handler: The completion handler to call when the load request is complete.

See also:

NSURLSessionMBS.downloadTaskWithResumeData(resumeData as MemoryBlock) as NSURLSessionDownloadTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task to resume a previously canceled or failed download.

resumeData: A data object that provides the data necessary to resume a download.

After you create the task, you must start it by calling its resume method.
This method is equivalent to the downloadTaskWithResumeData:completionHandler: with a nil completion handler. For detailed usage information, including ways to obtain a resume data object, see that method.

See also:

NSURLSessionMBS.downloadTaskWithResumeData(resumeData as MemoryBlock, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task to resume a previously canceled or failed download and calls a handler upon completion.

resumeData: A data object that provides the data necessary to resume the download.
Handler: The completion handler to call when the load request is complete.

See also:

NSURLSessionMBS.downloadTaskWithURL(URL as String) as NSURLSessionDownloadTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task that retrieves the contents of the specified URL and saves the results to a file.

url: The URL to download.

After you create the task, you must start it by calling its resume method.

See also:

Some examples using this method:

NSURLSessionMBS.downloadTaskWithURL(URL as String, handler as NSURLSessionUploadTaskCompletedMBS, tag as Variant = nil) as NSURLSessionDataTaskMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Networking MBS MacFrameworks Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a download task that retrieves the contents of the specified URL, saves the results to a file, and calls a handler upon completion.

url: An URL that provides the URL to download.
Handler: The completion handler to call when the load request is complete.

See also:

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


The biggest plugin in space...