libcurl based HTTP(S) Client for Swift.
- Add
SeeURL
toPackage.swift
of your project.
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/shiroyagicorp/swift-seeurl.git", majorVersion: 1, minor: 6)
]
)
Note: You may need to specify linker flags for libcurl while building your project.
swift build -Xlinker -L/usr/lib -Xlinker -lcurl
sudo apt-get install libcurl4-openssl-dev
let result = try HTTPClient.sendRequest("GET", "https://google.com")
print(result.statusCode, result.body)
MIT