@@ -54,27 +54,6 @@ extension URLSession {
5454 return ( data, response)
5555 }
5656
57- /// Convenience method to upload data using an `HTTPRequest`; creates and resumes a `URLSessionUploadTask` internally.
58- ///
59- /// - Parameter request: The `HTTPRequest` for which to upload data.
60- /// - Parameter fileURL: File to upload.
61- /// - Parameter delegate: Task-specific delegate.
62- /// - Returns: Data and response.
63- public func upload(
64- for request: HTTPRequest ,
65- fromFile fileURL: URL ,
66- delegate: ( any URLSessionTaskDelegate ) ? = nil
67- ) async throws -> ( Data , HTTPResponse ) {
68- guard let urlRequest = URLRequest ( httpRequest: request) else {
69- throw HTTPTypeConversionError . failedToConvertHTTPRequestToURLRequest
70- }
71- let ( data, urlResponse) = try await self . upload ( for: urlRequest, fromFile: fileURL, delegate: delegate)
72- guard let response = ( urlResponse as? HTTPURLResponse ) ? . httpResponse else {
73- throw HTTPTypeConversionError . failedToConvertURLResponseToHTTPResponse
74- }
75- return ( data, response)
76- }
77-
7857 /// Convenience method to upload data using an `HTTPRequest`, creates and resumes a `URLSessionUploadTask` internally.
7958 ///
8059 /// - Parameter request: The `HTTPRequest` for which to upload data.
@@ -154,22 +133,6 @@ extension URLSession {
154133 return ( data, response)
155134 }
156135
157- /// Convenience method to upload data using an `HTTPRequest`; creates and resumes a `URLSessionUploadTask` internally.
158- ///
159- /// - Parameter request: The `HTTPRequest` for which to upload data.
160- /// - Parameter fileURL: File to upload.
161- /// - Returns: Data and response.
162- public func upload( for request: HTTPRequest , fromFile fileURL: URL ) async throws -> ( Data , HTTPResponse ) {
163- guard let urlRequest = URLRequest ( httpRequest: request) else {
164- throw HTTPTypeConversionError . failedToConvertHTTPRequestToURLRequest
165- }
166- let ( data, urlResponse) = try await self . upload ( for: urlRequest, fromFile: fileURL)
167- guard let response = ( urlResponse as? HTTPURLResponse ) ? . httpResponse else {
168- throw HTTPTypeConversionError . failedToConvertURLResponseToHTTPResponse
169- }
170- return ( data, response)
171- }
172-
173136 /// Convenience method to upload data using an `HTTPRequest`, creates and resumes a `URLSessionUploadTask` internally.
174137 ///
175138 /// - Parameter request: The `HTTPRequest` for which to upload data.
0 commit comments