Get
Get copied to clipboard
Get 3.0
Prototype of the new Sendable-compliant APIs to address new Xcode 14.3 warnings and make the framework easier to user.
private struct User: Decodable {}
func usage() async throws {
let client = APIClient(baseURL: nil)
let dataTask = await client.dataTask(with: Request<User>(path: "/user"))
if #available(iOS 15, *) {
for await progress in dataTask.progress.values {
print(progress)
}
}
let response = try await dataTask.response.value
let data = try await dataTask.data
let string = try await dataTask.string
}