Skip to content

khoi/curl-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

➰ curl-swift status badge

An opinionated libcurl wrapper for Swift

⌨️ Usage

There are 2 ways to use this library which kinda represents libcurl-easy and libcurl-share

CURL.swift

Each request runs in total isolation.

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.

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.