title: How to send array by POST method to server?
body: <p>I am trying to send array as parameter to server but server is not receiving. Server have to receive two arrays that I am sending. But in server they are not appear ?? I dont know is it my mistake or mistake in the server ??
  My array name is testAns and testQuest and I have to send it to parameters: answer and quest.
  my Code:</p>
  
  <pre><code>let userID = UserDefaults.standard.string(forKey: "userID")
  let artID = UserDefaults.standard.string(forKey: "index")
  let myUrl = URL(string: "http://www.someurls.kz/modules/CheckTestF.php");
  var request = URLRequest(url:myUrl!)
  request.httpMethod = "POST"
  var testAns = [Int]()
  var testQuest = [Int]()
  testAns = [131,123,23]
  testQuest = [123,233,232]
  let postString = "uID=97B436E41&amp;idUser=\(userID!)&amp;art_id=\(artID!)&amp;answer=\(testAns)&amp;quest=\(testQuest)"
  print(postString)
  print(testAns,testQuest)
  request.httpBody = postString.data(using: String.Encoding.utf8);
  let task = URLSession.shared.dataTask(with: request) { (data: Data?, response: URLResponse?, error: Error?) in
      if error != nil
      {
          print("error=\(String(describing: error))")
          return
      }
      do {
          _ = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
      }
      catch {
          print(error)
      }
  
  }
  task.resume()
      }
  </code></pre>