put(url:body:headers:)
Sends data to the specified URL using the PUT method.
Declaration
func put(url: URL, body: Data, headers: [String : String] = [:]) async throws -> (Data, URLResponse)
Parameters
url
The URL of the resource to send data to.
body
The data to be uploaded.
headers
Optional dictionary of headers to include in the request (default: empty).
Return Value
The URL response.
Discussion
Note
Any error that may occur during the network request.