i need to send the json request parameters to the server using nsurl session in swift2.0. i don't know how to create the json request params.i created the params like this
let jsonObj = ["Username":"Admin", "Password":"123","DeviceId":"87878"]
// print("Params are \(jsonObj)")
//request.HTTPBody = try! NSJSONSerialization.dataWithJSONObject(jsonObj, options: [])
// or if you think the conversion might actually fail (which is unlikely if you built `params` yourself)
do {
request.HTTPBody = try NSJSONSerialization.dataWithJSONObject(jsonObj, options:.PrettyPrinted)
} catch {
print(error)
}
but its not ping to the method body so i am getting the failure response