Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/essentiaone/essentia-network-core-ios
Wrapper of NSURLRequest
https://github.com/essentiaone/essentia-network-core-ios
networkmanager nsurlrequest swift
Last synced: about 2 months ago
JSON representation
Wrapper of NSURLRequest
- Host: GitHub
- URL: https://github.com/essentiaone/essentia-network-core-ios
- Owner: essentiaone
- License: mit
- Created: 2018-09-15T14:33:33.000Z (over 6 years ago)
- Default Branch: develop
- Last Pushed: 2019-07-18T10:12:50.000Z (over 5 years ago)
- Last Synced: 2024-10-31T15:51:11.603Z (2 months ago)
- Topics: networkmanager, nsurlrequest, swift
- Language: Swift
- Homepage:
- Size: 226 KB
- Stars: 3
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/essentiaone/essentia-network-core-ios.svg?branch=develop)](https://travis-ci.com/essentiaone/essentia-network-core-ios)
[![Badge w/ Version](https://cocoapod-badges.herokuapp.com/v/essentia-network-core-ios/badge.png)](https://cocoadocs.org/docsets/essentia-network-core-ios)
[![Badge w/ Platform](https://cocoapod-badges.herokuapp.com/p/essentia-network-core-ios/badge.svg)](https://cocoadocs.org/docsets/essentia-network-core-ios)
[![Badge w/ Licence](https://cocoapod-badges.herokuapp.com/l/essentia-network-core-ios/badge.svg)](https://cocoadocs.org/docsets/essentia-network-core-ios)# Network Core
Network core it is library which wraps NSURLRequest in an easy way.
## Usage
1. Make enum which inherited of RequestProtocol
```Swift
enum TestEndpoint: RequestProtocol {
var path: String {
return "/todos/1"
}
var extraHeaders: [String : String]? {
return nil
}
var parameters: [String : Any]? {
return nil
}
var requestType: RequestType {
return .get
}
var contentType: RequestContentType {
return .json
}
case one
}
```
2. Initialize `NetworkManager`
```Swift
let network = NetworkManager("https://jsonplaceholder.typicode.com")
```
3. Make request
```Swift
network.makeRequest(TestEndpoint.one) { (result: Result) in
print(result)
}
```
## License
Network Core is released under the [MIT License](https://github.com/essentiaone/essentia-network-core-ios/blob/develop/LICENSE).