Contents

upload(for:from:)

Convenience method to upload data using a URLRequest, creates and resumes a URLSessionUploadTask internally.

Declaration

func upload(for request: URLRequest, from bodyData: Data) async throws -> (Data, URLResponse)

Parameters

  • request:

    The URLRequest for which to upload data.

  • bodyData:

    Data to upload.

Return Value

Data and response.

See Also

Performing asynchronous transfers