struct HttpBin: Codable {
let args: [String: String]?
let form: [String: String]?
let headers: [String: String]?
}
HttpRequest(url: "https://httpbin.org/get").json(HttpBin.self) { json, response in
print(json)
}
Data and String
HttpRequest(url: "https://httpbin.org/get").data() { data, response in
if let data {
let string = String(
data: data,
encoding: .utf8
)
print(string)
}
}
Swift Package Manager
https://github.com/mezhevikin/http-request.git
CocoaPods
pod 'HttpRequest', :git => 'https://github.com/mezhevikin/http-request.git'
HttpRequest
A tiny http client for iOS and macOS. Only 80 lines of code.
Get
Post
URLRequest and HTTPURLResponse
Json
Data and String
Swift Package Manager
CocoaPods
Links
🌐 HttpRequest for Kotlin/Android
💹 Best Currency Converter
☕️ Buy me a coffee