Instance Method インスタンスメソッド

upload(for:from:delegate:)

Uploads data to a URL based on the specified URL request and delivers the result asynchronously.

Declaration 宣言

func upload(for request: URLRequest, from bodyData: Data, delegate: URLSessionTaskDelegate? = nil) async throws -> (Data, URLResponse)

Parameters パラメータ

request

A URL request object that provides request-specific information such as the URL, cache policy, request type, and body data or body stream. リクエスト特有の情報、たとえばURL、キャッシュ方針、リクエスト型、ボディデータまたはボディストリーム、などを提供するURLリクエストオブジェクト。

bodyData

The body data for the request. リクエストに対するボディデータ。

delegate

A delegate that receives life cycle and authentication challenge callbacks as the transfer progresses.

Return Value 戻り値

An asynchronously-delivered tuple that contains any data returned by the server as a Data instance, and a URLResponse.

See Also 参照

Performing Asynchronous Transfers 非同期転送を実行する