essentia-network-core-ios 0.2.5

essentia-network-core-ios 0.2.5

Maintained by Pavlo Boiko.



  • By
  • impl

Build Status Badge w/ Version Badge w/ Platform Badge w/ Licence

Network Core

Network core it is library which wraps NSURLRequest in an easy way.

Usage

  1. Make enum which inherited of RequestProtocol
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
}
  1. Initialize NetworkManager
let network = NetworkManager("https://jsonplaceholder.typicode.com")
  1. Make request
network.makeRequest(TestEndpoint.one) { (result: Result<String>) in
    print(result)
}

License

Network Core is released under the MIT License.