From bc4cf498a855fe1da8a969d4fde13baaa29be1ad Mon Sep 17 00:00:00 2001 From: "zunda.dev@gmail.com" Date: Sat, 30 Nov 2024 14:21:53 +0900 Subject: [PATCH] delete file function --- .../Helpers/HTTP/URLSession+HTTPRequest.swift | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/Sources/Helpers/HTTP/URLSession+HTTPRequest.swift b/Sources/Helpers/HTTP/URLSession+HTTPRequest.swift index 23e1aabe..83a5828f 100644 --- a/Sources/Helpers/HTTP/URLSession+HTTPRequest.swift +++ b/Sources/Helpers/HTTP/URLSession+HTTPRequest.swift @@ -54,27 +54,6 @@ extension URLSession { return (data, response) } - /// Convenience method to upload data using an `HTTPRequest`; creates and resumes a `URLSessionUploadTask` internally. - /// - /// - Parameter request: The `HTTPRequest` for which to upload data. - /// - Parameter fileURL: File to upload. - /// - Parameter delegate: Task-specific delegate. - /// - Returns: Data and response. - public func upload( - for request: HTTPRequest, - fromFile fileURL: URL, - delegate: (any URLSessionTaskDelegate)? = nil - ) async throws -> (Data, HTTPResponse) { - guard let urlRequest = URLRequest(httpRequest: request) else { - throw HTTPTypeConversionError.failedToConvertHTTPRequestToURLRequest - } - let (data, urlResponse) = try await self.upload(for: urlRequest, fromFile: fileURL, delegate: delegate) - guard let response = (urlResponse as? HTTPURLResponse)?.httpResponse else { - throw HTTPTypeConversionError.failedToConvertURLResponseToHTTPResponse - } - return (data, response) - } - /// Convenience method to upload data using an `HTTPRequest`, creates and resumes a `URLSessionUploadTask` internally. /// /// - Parameter request: The `HTTPRequest` for which to upload data. @@ -154,22 +133,6 @@ extension URLSession { return (data, response) } - /// Convenience method to upload data using an `HTTPRequest`; creates and resumes a `URLSessionUploadTask` internally. - /// - /// - Parameter request: The `HTTPRequest` for which to upload data. - /// - Parameter fileURL: File to upload. - /// - Returns: Data and response. - public func upload(for request: HTTPRequest, fromFile fileURL: URL) async throws -> (Data, HTTPResponse) { - guard let urlRequest = URLRequest(httpRequest: request) else { - throw HTTPTypeConversionError.failedToConvertHTTPRequestToURLRequest - } - let (data, urlResponse) = try await self.upload(for: urlRequest, fromFile: fileURL) - guard let response = (urlResponse as? HTTPURLResponse)?.httpResponse else { - throw HTTPTypeConversionError.failedToConvertURLResponseToHTTPResponse - } - return (data, response) - } - /// Convenience method to upload data using an `HTTPRequest`, creates and resumes a `URLSessionUploadTask` internally. /// /// - Parameter request: The `HTTPRequest` for which to upload data.