From c46bd19407ae86d3dec50d8bd2eae84a317c1f9e Mon Sep 17 00:00:00 2001 From: Otavio Zabaleta Date: Tue, 16 Apr 2024 22:06:40 -0300 Subject: [PATCH] Small refactoring --- Sources/JSONHTTPClient/JSONHTTPClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/JSONHTTPClient/JSONHTTPClient.swift b/Sources/JSONHTTPClient/JSONHTTPClient.swift index 1fb7954..c9574b2 100644 --- a/Sources/JSONHTTPClient/JSONHTTPClient.swift +++ b/Sources/JSONHTTPClient/JSONHTTPClient.swift @@ -5,7 +5,7 @@ import Foundation @available(iOS 13.0.0, *) public protocol JSONHTTPClientType { - func get(_ url: URL, headers httpHeaders: [String: String]?) async throws -> T + func get(_ url: URL, httpHeaders: [String: String]?) async throws -> T func postJSON(_ url: URL, body: Data, httpHeaders: [String: String]?) async throws -> T } @@ -15,7 +15,7 @@ public struct JSONHTTPClient: JSONHTTPClientType { private init() {} - public func get(_ url: URL, headers httpHeaders: [String: String]?) async throws -> T { + public func get(_ url: URL, httpHeaders: [String: String]?) async throws -> T { try await connect(.get(url).headers(httpHeaders)) }