title: Swift 3 iOS HTTP Post
body: <p>This code gathers the data just fine, but the post is supposed to filter some data. I made an Android and Windows Universal app which all do the same thing, but I'm almost done with my iOS app, and I ran in to a wall here. What's wrong with my post code? I just want to post something and get the data returned async.</p>
  
  <pre><code>let geturl = URL(string: "http://myweb.com")!
          let appDelegate = UIApplication.shared.delegate as! AppDelegate
          appDelegate.showActivityIndicator(uiView: realMainTable4)
  
          var request = URLRequest(url: geturl)
          request.httpMethod = "POST"
          let postString = "filter=on"
          request.httpShouldHandleCookies = true
          request.httpBody = postString.data(using: String.Encoding.utf8)
          let session = URLSession.shared
  
          let task = session.dataTask(with: request, completionHandler: {(data, response, error) -&gt; Void in
  
              if data != nil {
                  let ret2 = String(data:data!, encoding: String.Encoding.utf8)
  
                  var myData = [String]()
                  myData = self.matches(num: 0, for: self.containerRegex, in: ret2)
                  for p in myData {
                      browseTitles.append(self.match(num: 1, for: self.titleRegex, in: p))
                      browseThumbs.append(self.match(num: 1, for: self.thumbRegex, in: p))
                      browseIDs.append(self.match(num: 1, for: self.idRegex, in: p))
                  }
  
                  DispatchQueue.main.async{
                      self.realMainTable4.reloadData()
                      appDelegate.hideActivityIndicator(uiView: self.realMainTable4)
                  }
              }
          })
          task.resume()
  </code></pre>