title: POST request in swift
body: <p>Okay I have looked high and low and can not find the answer. So I am just trying to make a simple POST request to a mashape api from an iPhone app. Here is what I have so far:</p>
  
  <pre><code>var headers: NSDictionary = ["X-Mashape-Key": "Hm5NokCvUamshPFfnQCRJKne3UuCp1C******************", "Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json"]
  
  var params = ["async": "0", "client_secret": "ceaf93f10f7330318ae*********************", "input": "&lt;required&gt;", "lang": "En", "memory_limit": "262144", "source": "From the web", "time_limit": "10"] as Dictionary
  
  var url : NSURL = NSURL(string: "https://blah.mashape.com/location/")!
  
  var request = NSMutableURLRequest(URL: url)
  var session = NSURLSession.sharedSession()
  
  var err: NSError?
  request.HTTPBody = NSJSONSerialization.dataWithJSONObject(params, options: nil, error: &amp;err) as NSData!
  
  if err != nil {
      println(err)
  }
  
  request.HTTPMethod = "POST"
  request.allHTTPHeaderFields = headers
  
  var task = session.dataTaskWithRequest(request, completionHandler: {data, response, error -&gt; Void in
      println("Response: \(response)")
      var strData = NSString(data: data, encoding: NSUTF8StringEncoding)
      println("Body: \(strData)")
  })
  
  task.resume()
  </code></pre>
  
  <p>But the strData says this this when I get the response:</p>
  
  <pre><code>Body: Optional({"errors": {}, "code_id": "cc6581D", "message": "ArgumentMissingError: client_secret is needed!", "run_status": {"status": "AC", "time_limit": 5, "output_html": "a[0]&amp;nbsp;=&amp;nbsp;10&lt;br&gt;a[1]&amp;nbsp;=&amp;nbsp;11&lt;br&gt;a[2]&amp;nbsp;=&amp;nbsp;12&lt;br&gt;a[3]&amp;nbsp;=&amp;nbsp;13&lt;br&gt;a[4]&amp;nbsp;=&amp;nbsp;14&lt;br&gt;a[5]&amp;nbsp;=&amp;nbsp;15&lt;br&gt;a[6]&amp;nbsp;=&amp;nbsp;16&lt;br&gt;a[7]&amp;nbsp;=&amp;nbsp;17&lt;br&gt;a[8]&amp;nbsp;=&amp;nbsp;18&lt;br&gt;a[9]&amp;nbsp;=&amp;nbsp;19&lt;br&gt;", "memory_limit": 262144, "time_used": "0.1006", "signal": "OTHER", "status_detail": "N/A", "output": "a[0] = 10\na[1] = 11\na[2] = 12\na[3] = 13\na[4] = 14\na[5] = 15\na[6] = 16\na[7] = 17\na[8] = 18\na[9] = 19\n", "async": 0, "memory_used": "64"}, "compile_status": "OK", "web_link": "http://blah.com/cc6581D"})
  </code></pre>
  
  <p>it says that the client_secret is needed but I include it in the params dictionary? Any help would be appreciated!</p>