How to POST JSON data using NSURLSession in swift
问题 I am stuck with the below code. How do I set the param and in post method? let params:[String:Any] = [ "email" : usr, "userPwd" : pwdCode] let url = NSURL(string:"http://inspect.dev.cbre.eu/SyncServices/api/jobmanagement/PlusContactAuthentication") let request = NSMutableURLRequest(URL: url!) request.setValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") request.HTTPBody = params<what should do for Json parameter> let task = NSURLSession.sharedSession()