Snapshot của kean/Get: 988★ · Swift. Web API client built using async/await
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A lean Swift web API client built using async/await.
Get provides a clear and convenient API for modeling network requests using Request<Response> type. And its APIClient makes it easy to execute these requests and decode the responses.
// Create a client
let client = APIClient(baseURL: URL(string: "https://api.github.com"))
// Start sending requests
let user: User = try await client.send(Request(path: "/user")).value
var request = Request(path: "/user/emails", method: .post, body: ["[email protected]"])
try await client.send(request)
The client uses URLSession for networking and provides complete access to all its APIs. It is designed with the "less is more" idea in mind and doesn't introduce any unnecessary abstractions on top of native APIs.
// In addition to `APIClientDelegate`, you can also override any methods
// from `URLSessionDelegate` family of APIs.
let client = APIClient(baseURL: URL(string: "https://api.github.com")) {
$0.sessionDelegate = ...
}
// You can also provide task-specific delegates and easily change any of
// the `URLRequest` properties before the request is sent.
let delegate: URLSessionDataDelegate = ...
let response = try await client.send(Paths.user.get, delegate: delegate) {
$0.cachePolicy = .reloadIgnoringLocalCacheData
}
In addition to sending quick requests, it also supports downloading data to a file, uploading from a file, authentication, auto-retries, logging, and more. It's a kind of code that you would typically write on top of URLSession if you were using it directly.
Sponsor 💖
Support Get on GitHub Sponsors.
Documentation
Learn how to use Get by going through the documentation created using DocC.
To learn more about URLSession, see URL Loading System.
Integrations
Pulse
You can easily add logging to your API client using Pulse. It requests a single line to setup.
With Pulse, you can inspect logs directly on your device – and it supports all Apple platforms. And you can share the logs at any time and view them on a big screen using Pulse Pro.
CreateAPI
With CreateAPI, you can take your backend OpenAPI spec, and generate all of the response entities and even requests for Get APIClient.
Check out App Store Connect Swift SDK that uses CreateAPI for code generation.
Other Extensions
Get is a lean framework with a lot of flexibility and customization points. It makes it very easy to learn and use, but you'll need to install additional modules for certain features.
Mocker – mocking network requests for testing purposes
URLQueryEncoder – URL query encoder with Codable support
MultipartFormDataKit – adds support for multipart/form-data
NaiveDate – working with dates without timezones
Minimum Requirements
Get
Date
Swift
Xcode
Platforms
2.2
Apr 13, 2024
5.8
14.3
iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0, Linux
2.0
Jul 26, 2022
5.5
13.3
iOS 13.0, watchOS 6.0, macOS 10.15, tvOS 13.0, Linux
License
Get is available under the MIT license. See the LICENSE file for more info.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/kean/Get là nguồn chính thức.
kean/Get có phải mã nguồn mở không?
Có — kean/Get phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/kean/Get.
kean/Get có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho kean/Get. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
kean/Get dùng license gì?
kean/Get phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
kean/Get là gì?
kean/Get (kean/Get) là dự án Swift trên GitHub. Theo mô tả gốc: Web API client built using async/await
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về Get?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về Get.