I want to send a list of the array to the server but I have troubles on it.
This is my backend information that I should send data like this.
This is my code:
loadRequest(request: "/tripTemporary/", parameters:
["startDate":"\(FindDriverViewController.dateToGo)",
"startTime":"\(FindDriverViewController.timeTOGo)",
"passengerNumber":"\(FindDriverViewController.PasengerCount)",
"typeId":"\(ServiceModeViewController.serviceMode)",
"originName":"\(MapViewController.sourceCity)",
"destinationName":"\(MapViewController.destinationCity)",
"passengerId":"\(ViewController.id)",
"tripCheckPoints":"{['address':'\(MapViewController.source)','longitude':'\(MapViewController.sourceLng)','latitude':'\(MapViewController.sourceLat)'],['address':'\(MapViewController.destination)','longitude':'\(MapViewController.Destinationlng)','latitude':'\(MapViewController.DestinationLat)']}"
],
json: true, get: false, callback: { (data) in
print(NSString(data: data!, encoding: String.Encoding.utf8.rawValue)!)
}, method: "POST")
Please help me.
NSString(data: data!, encoding: String.Encoding.utf8.rawValue)!withString(data: data!, encoding: .utf8)!. There is no reason to useNSStringin this case.