Created
August 26, 2016 07:05
-
-
Save anonymous/6698fc40f2be33c069a7313237e7c1c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//POST Request | |
class func requestPOSTURL (strURL: String, params: [String : AnyObject]?, headers: [String : String]?, success: (JSON) -> Void, failure:(NSError) -> Void){ | |
Alamofire.request(.POST,strURL, parameters: params, encoding: ParameterEncoding.JSON, headers: headers).responseJSON { (responseObject) -> Void in | |
// print(responseObject) | |
if responseObject.result.isSuccess{ | |
let resJson = JSON(responseObject.result.value!) | |
success(resJson) | |
} | |
if responseObject.result.isFailure{ | |
let error: NSError = responseObject.result.error! | |
failure(error) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment