title: Swift post request error 500
body: <p>Im trying to post a http request with parameters, the response is XML Formatted.
  see: <a href="https://www.codepunker.com/tools/http-requests/64243-brrjq9t" rel="nofollow noreferrer">https://www.codepunker.com/tools/http-requests/64243-brrjq9t</a>
  now, when I try to code that im always getting the same error 500. what I do wrong?</p>
  
  <pre><code> guard let url = URL(string: "http://www.nakdan.com/GetResult.aspx") else { return }
      var request = URLRequest(url: url)
      request.httpMethod = "POST"
      request.addValue("text/xml; charset=utf-8", forHTTPHeaderField: "Content-Type")
      var bodyData = "txt=מה קורה&amp;usr=&amp;pass=&amp;ktivmale=false"
      request.httpBody = bodyData.data(using: String.Encoding.utf8);
  
      let task = URLSession.shared.dataTask(with: request as URLRequest){
          data,response, error in
  
          print(response!)
          if error != nil{
              print("error")
              return
          }
  
      }
  
      task.resume()
  </code></pre>