title: URLSession.shared.dataTask Data is Always Empty When Hitting Node Express Endpoint
body: <p>I have a simple Node Express endpoint that I can successfully hit with curl:</p>
  
  <pre><code>curl --header "Content-Type: application/json" \
    --request POST \
    --data '{"lat":33.485834000000001,"long":-100.106417}' \
    http://192.168.99.100:49160/login
  {"status":200,"data":{"userId":"bff37d9c-25a9-421b-aa58-eba0fef0da03"},"message":null}
  </code></pre>
  
  <p>However, when I try to hit the same endpoint but using Swift 4 with the following:</p>
  
  <pre><code>let task = URLSession.shared.dataTask(with: urlRequest) { data, response, error in
              guard let serverData = data, error == nil else {
                  handler(ResponseBuilder().set(error: ErrorType.network).build())
  
                  return
              }
  
             // Process data.
          }
          task.resume()
  </code></pre>
  
  <p>The 'data' that is returned to me by the URLSession has nothing in it. I expect the data the contain the same value as what curl returned above.</p>
  
  <p>The 'response' is populated as I would expect:</p>
  
  <pre><code>Optional&lt;NSURLResponse&gt;
    - some : &lt;NSHTTPURLResponse: 0x600000a1a5a0&gt; { URL: http://192.168.99.100:49160/login } { Status Code: 200, Headers {
      Connection =     (
          "keep-alive"
      );
      "Content-Length" =     (
          86
      );
      "Content-Type" =     (
          "application/json; charset=utf-8"
      );
      Date =     (
          "Thu, 25 Oct 2018 05:51:39 GMT"
      );
      Etag =     (
          "W/\"56-8ZCdAcNDopMfakzfNDEniZ0fgoc\""
      );
      "X-Powered-By" =     (
          Express
      );
  } }
  </code></pre>
  
  <p>'error' is nil and I am seeing logging on the server to indicate that it is being hit but data is still empty.</p>
  
  <p>I am running my iOS app using the Simulator. </p>
  
  <p>Am I missing something obvious here?</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>To answer some of the questions below. 'urlRequest' is created as follows:</p>
  
  <pre><code>var urlRequest = URLRequest(url: request.url)
  urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
  urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")
  urlRequest.httpMethod = "POST"
  urlRequest.httpBody = try? JSONSerialization.data(withJSONObject: request.data, options: .prettyPrinted)
  </code></pre>
  
  <p>where 'request' is just a wrapper object I use and it's contents is:</p>
  
  <pre><code>Request
    ▿ url : http://192.168.99.100:49160/login
      - _url : http://192.168.99.100:49160/login
    ▿ data : 2 elements
      ▿ 0 : 2 elements
        - key : "lat"
        - value : 33.485834000000001
      ▿ 1 : 2 elements
        - key : "long"
        - value : -100.106417
  </code></pre>
  
  <p><strong>UPDATE 3</strong></p>
  
  <p>As someone suggested I installed Charles Proxy. Here are the results:</p>
  
  <p>Request:</p>
  
  <pre><code>{
    "lat" : 33.485834000000001,
    "long" : -100.106417
  }
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>{"status":200,"data":{"userId":"3d559555-c0ad-4e3a-a10b-3e267ee7f662"},"message":null}
  </code></pre>