Skip to content

Commit

Permalink
Merge pull request #2 from otaviokz/v1.0.3
Browse files Browse the repository at this point in the history
Small refactoring
  • Loading branch information
otaviokz authored Apr 17, 2024
2 parents 6a0120d + c46bd19 commit 23c1671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/JSONHTTPClient/JSONHTTPClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation

@available(iOS 13.0.0, *)
public protocol JSONHTTPClientType {
func get<T: Decodable>(_ url: URL, headers httpHeaders: [String: String]?) async throws -> T
func get<T: Decodable>(_ url: URL, httpHeaders: [String: String]?) async throws -> T
func postJSON<T: Decodable>(_ url: URL, body: Data, httpHeaders: [String: String]?) async throws -> T
}

Expand All @@ -15,7 +15,7 @@ public struct JSONHTTPClient: JSONHTTPClientType {

private init() {}

public func get<T: Decodable>(_ url: URL, headers httpHeaders: [String: String]?) async throws -> T {
public func get<T: Decodable>(_ url: URL, httpHeaders: [String: String]?) async throws -> T {
try await connect(.get(url).headers(httpHeaders))

}
Expand Down

0 comments on commit 23c1671

Please sign in to comment.