SynchronousNetworking
Simple synchronous cross-platform networking for Swift CLI apps.
Installation
Swift Package Manager
dependencies: [
.package(url: "https://github.com/HeshamMegid/SynchronousNetworking", .upToNextMajor(from: "0.0.1")
]
Usage
let networking = SynchronousNetworking(baseUrl: URL(string: "http://example.com/")!)
let parameters = ["param1": "value1"]
let networkResponse = networking.getSynchronously(path: "path/to/endpoint/", parameters: parameters)
if let data = networkResponse.data {
// Use data
}