Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

onmyway133/EasyNetworking

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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.