title: iOS Simulator not sending http requests to localhost mac running tomcat webservice
body: <blockquote>
    <p>Important information, I am running all this under a TestCase.</p>
  </blockquote>
  
  <p>My URL is <code>http://my-MacBook-Pro.local:8080/myapi/v2/Driver/getDriver?domain=123&amp;driver=125&amp;key=9808098</code></p>
  
  <p>If I paste this URL on <code>Safari</code> running on the same <code>iPhone Simulator</code>. It responds with the JSON. I noticed my catalina.out reported this request.</p>
  
  <p>I have enabled <code>Allow HTTP Services</code> on <code>Settings-&gt;Developer</code>.</p>
  
  <p>This is the code snippet</p>
  
  <pre><code>print("fullurl -&gt;"+urlComponents.url!.absoluteString)
  
  URLSession.shared.dataTask(with: urlComponents.url!, completionHandler: {
          (data, response, error) in
          if(error != nil){
              print("error")
          }else{
              do{
                  let json = try JSONSerialization.jsonObject(with: data!, options:.allowFragments) as! [String : AnyObject]
                  print (json)
  
              }catch let error as NSError{
                  print(error)
              }
          }
      }).resume()
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http/32560433#32560433">Reference</a>
  Added the following to <code>info.plist</code>, still my http request did not get thru to my <code>localhost</code> mac running tomcat on <code>port 8080</code></p>
  
  <pre><code>&lt;dict&gt;
          &lt;key&gt;NSExceptionDomains&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;My-MacBook-Pro.local&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSExceptionMinimumTLSVersion&lt;/key&gt;
                  &lt;string&gt;TLSv1.1&lt;/string&gt;
                  &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/dict&gt; 
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>Tried even with these settings in <code>info.plist</code>. No impact. Did a <code>Clean</code>, yet no impact.</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSAllowsArbitraryLoadsInWebContent&lt;/key&gt;
          &lt;true/&gt;
          &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
          &lt;true/&gt;
      &lt;/dict&gt;
  </code></pre>
  
  <p>Something wrong with my code I guess.</p>