Latest | 0.4.2 |
---|---|
Homepage | https://github.com/kansaraprateek/WebService |
License | MIT |
Platforms | ios 8.0 |
Authors |
[](https://travis-ci.org/Prateek Kansara/WebService)
Requirements
- iOS 8.0+
- Xcode 7.3.1+
Installation
WebService is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod "WebService"
Usage
// Import webService class
import WebService
// Basic Header Dictionary
var httpHeaderRequestDict : NSMutableDictionary!{
get{
let mutableDict : NSMutableDictionary = NSMutableDictionary()
mutableDict.setValue("AUTHKEY", forKey: "Authorization")
mutableDict.setValue("application/json", forKey: "Content-Type")
return mutableDict
}
}
// Create webService object
var webServiceObject : WebService = WebService()
// Set header value for all request
webServiceObject.setDefaultHeaders(httpHeaderRequestDict)
* use webServiceObject.httpHeaders to set different headers required for this call.
webServiceObject.sendRequest(URLString, parameters: params, requestType: .GET, success: {
(response : NSHTTPURLResponse?, dictionary : AnyObject) in
// Handle data when request Success
}, failed: {
(response : NSHTTPURLResponse?, ResponseDict : AnyObject?) in
// Handle data when request fails
}, encoded: false)
Example
To run the example project, clone the repo, and run pod install
from the Example directory first.
Author
Prateek Kansara, [email protected]
License
WebService is available under the MIT license. See the LICENSE file for more info.
Latest podspec
{ "name": "WebService", "version": "0.4.2", "summary": "Basic HTTPS Service call block methods", "description": "TODO: Add long description of the pod here.", "homepage": "https://github.com/kansaraprateek/WebService", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Prateek Kansara": "[email protected]" }, "source": { "git": "https://github.com/kansaraprateek/WebService.git", "tag": "0.4.2" }, "platforms": { "ios": "8.0" }, "source_files": "WebService/Classes/*.swift", "pushed_with_swift_version": "3.0" }
Sat, 18 Mar 2017 18:00:03 +0000