/EasyNetworking

🛰Easy networking with async/await

Primary LanguageSwiftOtherNOASSERTION

EasyNetworking

❤️ Support my apps ❤️

❤️❤️😇😍🤘❤️❤️

Description

EasyNetworking is a lightweight networking framework for use with async/await

Features

  • Safe URLRequest builder
  • Polyfill async URLSession APIs
  • Mock
var client = Client(session: .shared)
client.hook.request = {
    Logger.log(request: $0)
}
client.hook.response = { request, response in
    // Perform mock here
    response
}

var request = Request(url: feedUrl)
request.method = .get
request.headers["Content-Type"] = "application/json"

let response = try await client.data(for: request)

Installation

EasyNetworking is also available through Swift Package Manager

.package(url: "https://github.com/onmyway133/EasyNetworking", from: "1.0.0")

Author

Khoa Pham, onmyway133@gmail.com

License

EasyNetworking is available under the MIT license. See the LICENSE file for more info.