共用方式為


NSUrlConnection.SendRequestAsync(NSUrlRequest, NSOperationQueue) 方法

定義

載入資料,並在完成時叫用方法。

[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>

參數

request
NSUrlRequest

要求執行

queue
NSOperationQueue

要分派完成的作業佇列。

傳回

表示非同步 SendAsynchronousRequest 作業的工作。 TResult 參數的值的類型為 Action<Foundation.NSUrlAsyncResult>

屬性

備註

SendRequestAsync 方法適合搭配 C# 非同步使用,方法是將控制項傳回給代表作業之 Task 的呼叫端。

適用於