[api-upload-refactor] Document API usage, link from README
This commit is contained in:
16
README.md
16
README.md
@@ -10,6 +10,7 @@ This is a repository of essential scripts written in Swift for Loverde Co. used
|
||||
|
||||
## Features
|
||||
- [x] Many usefull scripts extensions
|
||||
- [x] `API` — typed async networking + multipart uploads. See **[Documentation/API.md](Documentation/API.md)**
|
||||
|
||||
|
||||
Installation
|
||||
@@ -50,6 +51,21 @@ self.navigationController?.popViewControllerWithHandler {
|
||||
//Do some stuff after pop
|
||||
}
|
||||
```
|
||||
* Networking with `API`
|
||||
|
||||
```swift
|
||||
struct User: Decodable, Sendable { let id: Int; let name: String }
|
||||
|
||||
let user: User = try await API.shared.request(
|
||||
url: "https://api.example.com/users/{id}",
|
||||
method: .get,
|
||||
pathParams: ["id": "42"]
|
||||
)
|
||||
```
|
||||
|
||||
Full guide — requests, uploads, client certificates, error handling, and why it
|
||||
beats a hand-rolled `URLSession`: **[Documentation/API.md](Documentation/API.md)**
|
||||
|
||||
## Another components
|
||||
> LCESnackBarView - **great way to send feedback to user**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user