Edit

Share via


NSUrlConnection.SendRequestAsync(NSUrlRequest, NSOperationQueue) Method

Definition

Loads the data and invokes a method upon completion.

[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.TvOS, 9, 0, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.MacOSX, 10, 11, ObjCRuntime.PlatformArchitecture.None, "Use 'NSUrlSession.CreateDataTask' instead.")]
public static System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult> SendRequestAsync (Foundation.NSUrlRequest request, Foundation.NSOperationQueue queue);
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult> SendRequestAsync (Foundation.NSUrlRequest request, Foundation.NSOperationQueue queue);
static member SendRequestAsync : Foundation.NSUrlRequest * Foundation.NSOperationQueue -> System.Threading.Tasks.Task<Foundation.NSUrlAsyncResult>

Parameters

request
NSUrlRequest

Request to perform

queue
NSOperationQueue

Operation queue to dispatch the completion to.

Returns

A task that represents the asynchronous SendAsynchronousRequest operation. The value of the TResult parameter is of type Action<Foundation.NSUrlAsyncResult>.

Attributes

Remarks

The SendRequestAsync method is suitable to be used with C# async by returning control to the caller with a Task representing the operation.

Applies to