Skip to content

shakurocom/HTTPClient

Repository files navigation

Shakuro HTTPClient

HTTPClient

Version Platform License MIT

HTTPClient is a Swift library designed to abstract away access to Alamofire. The main purpose of the HTTPClient component is to encapsulate endpoints description inside some network abstraction layer to avoid calling Alamofire directly. Enums are used to define enpoints. This allows to make compile-time checks for correct API endpoint accesses.

Requirements

  • iOS 13.0+
  • Xcode 15.0+
  • Swift 5.0+

Installation

CocoaPods

To integrate HTTPClient into your Xcode project with CocoaPods, specify it in your Podfile:

pod 'Shakuro.HTTPClient'

Then, run the following command:

$ pod install

Manually

If you prefer not to use CocoaPods, you can integrate Shakuro.HTTPClient simply by copying it to your project.

Usage

  1. Create a couple of endpoints by adopting HTTPClientAPIEndPoint protocol.
  2. Create responses parsers by adopting HTTPClientParser protocol.
  3. Create new instance of HTTPClient class.
  4. Start your HTTP request by calling .sendRequest. You should use completions to handle parsed results.

Take a look at the HTTPClient_Example for more info.

License

Shakuro.HTTPClient is released under the MIT license. See LICENSE for details.

Give it a try and reach us

Star this tool if you like it. This will help us grow and add new useful things. Feel free to reach out and hire our team to develop a mobile or web project for you.