https://github.com/khoi/curl-swift
libcurl wrapper for Swift
https://github.com/khoi/curl-swift
curl libcurl swift swift-package-manager
Last synced: 10 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T14:18:24.000Z (almost 4 years ago)
- Last Synced: 2025-06-19T20:16:50.358Z (12 months ago)
- Topics: curl, libcurl, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 41 KB
- Stars: 23
- Watchers: 1
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ➰ curl-swift 
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.