Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khoi/curl-swift
libcurl wrapper for Swift
https://github.com/khoi/curl-swift
curl libcurl swift swift-package-manager
Last synced: 4 months ago
JSON representation
libcurl wrapper for Swift
- Host: GitHub
- URL: https://github.com/khoi/curl-swift
- Owner: khoi
- License: gpl-3.0
- Created: 2022-06-19T04:37:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T14:18:24.000Z (over 2 years ago)
- Last Synced: 2024-09-30T02:40:58.985Z (4 months ago)
- Topics: curl, libcurl, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 41 KB
- Stars: 20
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ➰ curl-swift ![status badge](https://github.com/khoi/curl-swift/actions/workflows/test.yml/badge.svg)
An opinionated `libcurl` wrapper for Swift
## ⌨️ Usage
There are 2 ways to use this library which kinda represents [libcurl-easy](https://curl.se/libcurl/c/libcurl-easy.html) and [libcurl-share](https://curl.se/libcurl/c/libcurl-share.html)
### `CURL.swift`
Each request runs in total isolation.```swift
let req = CURL(
method: "GET",
url:
"https://httpbin.org/get"
)
let res = try req.perform()
```### `CURLSH.swift`
Allow multiple requests to share cookies, dns cache, ssl session, and other goodies.```swift
let share = CURLSH()
let res = try share.perform(curl: req)
```## 🏛 Design choices
- The url string passed in will not be escaped, handle it at the call-site.