title: How to convert this to a POST call with a JSON serialized Object
body: <p>I have tried Alamofire, I have tried it with all my heart. It just does not work for me. I finally got http GET working, but I need to get http POST working. Our POST API's take a Request object that has all the necessary data in it. I have requested the backend developers to provide me with a KEY-VALUE pair JSON (no embedded objects/arrays) so that I can use a Dictionary in my swift code convert that to json and send the request. All I need is now to convert the below code to POST.</p>
  
  <p>My earlier questions that did not help much.
  <a href="https://stackoverflow.com/questions/42276134/nsinvalidargumentexception-invalid-type-in-json-write-demographicspojo">NSInvalidArgumentException Invalid type in JSON write DemographicsPojo
  </a>
  <a href="https://stackoverflow.com/questions/42113651/swift-3-0-alamofire-4-0-extra-argument-method-in-call">Swift 3.0, Alamofire 4.0 Extra argument 'method' in call</a></p>
  
  <p>I have given up on Alamofire. I want to use Foundation classes. Simple basic and fundamental way of life :).</p>
  
  <pre><code> func callWebService(url : String) {
          // Show MBProgressHUD Here
          var config                              :URLSessionConfiguration!
          var urlSession                          :URLSession!
  
          config = URLSessionConfiguration.default
          urlSession = URLSession(configuration: config)
  
          // MARK:- HeaderField
          let HTTPHeaderField_ContentType         = "Content-Type"
  
          // MARK:- ContentType
          let ContentType_ApplicationJson         = "application/json"
  
          //MARK: HTTPMethod
          let HTTPMethod_Get                      = "GET"
  
          let callURL = URL.init(string: url)
  
          var request = URLRequest.init(url: callURL!)
  
          request.timeoutInterval = 60.0 // TimeoutInterval in Second
          request.cachePolicy = URLRequest.CachePolicy.reloadIgnoringLocalCacheData
          request.addValue(ContentType_ApplicationJson, forHTTPHeaderField: HTTPHeaderField_ContentType)
          request.httpMethod = HTTPMethod_Get
  
          let dataTask = urlSession.dataTask(with: request) { (data,response,error) in
              if error != nil{
                  print("Error **")
  
                  return
              }
              do {
                  let resultJson = try JSONSerialization.jsonObject(with: data!, options: []) as? [String:AnyObject]
                  print("Result",resultJson!)
              } catch {
                  print("Error -&gt; \(error)")
              }
          }
  
          dataTask.resume()
          print("..In Background..")
      }
  </code></pre>