I want to make a POST request and pass some parameters. The parameters I want to pass is:
- Item : String
- Length : String
- Names : String Array
- Age : String
Today I´m doing this
var URL: NSURL = NSURL(string: "URL")!
var request:NSMutableURLRequest = NSMutableURLRequest(URL:URL)
request.HTTPMethod = "POST"
request.HTTPBody = // parameters here?
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue()) {
(response, data, error) in
println(NSString(data: data, encoding: NSUTF8StringEncoding))
}
Can anyone provide help of how to pass the above parameters in my request? I´m not quite sure how to do that.