Skip to content

ACMNetworking is a package that help developers to make requests easily.

License

Notifications You must be signed in to change notification settings

AppcentMobile/ACMNetworking

ACMNetworking

ACMNetworking is a network library that help developers to make requests easily.

Install

Via Cocoapods

pod 'ACMNetworking'

Via SPM, add new package, search url below

https://github.com/AppcentMobile/ACMNetworking

Basic Usage

  • Create plist file called ACMConfig
  • Add these keys
baseURL (String)(without http(s))
isLogEnabled (Bool)
timeout (Number)
  • Build a request via builder
let endpoint = ACMEndpoint()
            .set(method: .get)
            .set(path: BAPathModel(path: "products", value: id))
            .add(header: BAHeaderModel(field: "fieldOne", value: "valueOne"))
            .add(header: BAHeaderModel(field: "fieldTwo", value: "valueTwo"))
            .add(queryItem: BAQueryModel(name: "nameOne", value: "valueOne"))
            .add(queryItem: BAQueryModel(name: "nameTwo", value: "valueTwo"))
            .build()
  • Make request!
network.request(to: endpoint) { (response: ProductResponse) in
                print(response)
            } onProgress: { model in {
                print(model.formattedPercentage())
            } onError: { error in
                print(error)
            }

Example Project

https://github.com/AppcentMobile/ACMNetworkingSample

Documentation

https://acmnetworking-fbacf.web.app

License

About

ACMNetworking is a package that help developers to make requests easily.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published