title: App Transport Security Xcode 7 beta 6
body: <p>I'm currently working on <strong>Xcode 7 beta 6</strong>.  I'm trying to send a "DELETE" request to <a href="http://mySubdomain.herokuapp.com">http://mySubdomain.herokuapp.com</a>  </p>
  
  <p>The error I receive is:</p>
  
  <blockquote>
    <p>App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.<br>
        Error making API call: Error Domain=NSURLErrorDomain Code=-1022 The resource could not be loaded because the App Transport Security policy requires the use of a secure connection.<br>
       NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection., NSUnderlyingError=0x796f7ef0 {Error Domain=kCFErrorDomainCFNetwork Code=-1022 "(null)"}}</p>
  </blockquote>
  
  <p>In my actual API call I put "https" instead of "http" and that actually worked for my POST requests.  But the DELETE request throws the above error.</p>
  
  <p>I've seen solutions on here that involve the pList file, but none of them have worked for me.  I've listed my attempts below.</p>
  
  <p>First attempt:</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
  &lt;dict&gt;
    &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
        &lt;true/&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>Second try:</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
  &lt;dict&gt;
      &lt;key&gt;NSExceptionDomains&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;herokuapp.com&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;NSExceptionRequiresForwardSecrecy&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;NSExceptionMinimumTLSVersion&lt;/key&gt;
              &lt;string&gt;TLSv1.2&lt;/string&gt;
              &lt;key&gt;NSThirdPartyExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
              &lt;true/&gt;
              &lt;key&gt;NSThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
              &lt;false/&gt;
              &lt;key&gt;NSThirdPartyExceptionMinimumTLSVersion&lt;/key&gt;
              &lt;string&gt;TLSv1.2&lt;/string&gt;
              &lt;key&gt;NSRequiresCertificateTransparency&lt;/key&gt;
              &lt;false/&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  &lt;/dict&gt;
  </code></pre>
  
  <p>And finally, I even put all these temporary keys in like so:</p>
  
  <pre><code>&lt;key&gt;NSAppTransportSecurity&lt;/key&gt;
      &lt;dict&gt;
          &lt;key&gt;NSExceptionDomains&lt;/key&gt;
          &lt;dict&gt;
              &lt;key&gt;herokuapp.com&lt;/key&gt;
              &lt;dict&gt;
                  &lt;key&gt;NSIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSTemporaryIncludesSubdomains&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSTemporaryExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;NSTemporaryExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;NSExceptionMinimumTLSVersion&lt;/key&gt;
                  &lt;string&gt;TLSv1.2&lt;/string&gt;
                  &lt;key&gt;NSTemporaryExceptionMinimumTLSVersion&lt;/key&gt;
                  &lt;string&gt;TLSv1.2&lt;/string&gt;
                  &lt;key&gt;NSThirdPartyExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSTemporaryThirdPartyExceptionAllowsInsecureHTTPLoads&lt;/key&gt;
                  &lt;true/&gt;
                  &lt;key&gt;NSThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;NSTemporaryThirdPartyExceptionRequiresForwardSecrecy&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;NSThirdPartyExceptionMinimumTLSVersion&lt;/key&gt;
                  &lt;string&gt;TLSv1.2&lt;/string&gt;
                  &lt;key&gt;NSTemporaryThirdPartyExceptionMinimumTLSVersion&lt;/key&gt;
                  &lt;string&gt;TLSv1.2&lt;/string&gt;
                  &lt;key&gt;NSRequiresCertificateTransparency&lt;/key&gt;
                  &lt;false/&gt;
                  &lt;key&gt;NSTemporaryRequiresCertificateTransparency&lt;/key&gt;
                  &lt;false/&gt;
              &lt;/dict&gt;
          &lt;/dict&gt;
      &lt;/dict&gt;
  </code></pre>
  
  <p>All with no luck!  I always get the same error.  The DELETE request is formatted correctly because when I manually do it from Postman, I get the desired result.  </p>
  
  <p>Here is what my actual API call method looks like, just in case there could be an issue here:</p>
  
  <pre><code>class func makeDELETEALLRequest(completion: (error:Bool) -&gt; Void) {
          let session = NSURLSession.sharedSession()
          let url = NSURL(string:"https://mysubdomain.herokuapp.com/42kh24kh2kj2g24/clean")
          let request = NSMutableURLRequest(URL: url!)
          request.HTTPMethod = "DELETE"
  
          let task = session.dataTaskWithRequest(request) { (data, response, error) -&gt; Void in
  
              if (error != nil) {
                  print("Error making API call: \(error!)")
                  completion(error: true)
              } else {
                  let HTTPResponse = response as! NSHTTPURLResponse
                  let statusCode = HTTPResponse.statusCode
                  if (statusCode == 200){
                      print("Successfully deleted!")
                      completion(error: false)
                  } else {
                      print("Different status code: \(statusCode)")
                      completion(error: true)
                  }
              }
          }
          task.resume()
      }
  </code></pre>
  
  <p>Once again, I'm using <strong>Xcode 7 beta 6</strong>.  </p>
  
  <p><strong>ABOUT MY SELECTED ANSWER</strong>
  The answer I selected as correct was right for me because I made all these changes to the wrong pList file in my project and that answer was the only one that addressed the possibility.  The solutions offered by the other answers are not wrong, so any other people experiencing this issue should give them a try, since they are valid.  I hope this helps anyone having similar issues.</p>