Swift 2 JSON POST request [dictionary vs. String for HTTPBody of NSMutableURLRequest]
问题 I have the following swift code that submits a POST request successfully. let request = NSMutableURLRequest(URL: NSURL(string: url)!) let session = NSURLSession.sharedSession() request.HTTPMethod = "POST" request.HTTPBody = "foo=bar&baz=lee".dataUsingEncoding(NSUTF8StringEncoding) let task = session.dataTaskWithRequest(request, completionHandler: completionHandler) Instead of using query parameter like syntax, I'd like to use a dictionary, but when I do the following: let request =