title: NetworkSecurityConfig: No Network Security Config specified, using platform default Error response code: 400
body: <p>I'm trying to connect to either of these places and get the JSON data:-</p>
  
  <pre><code>https://content.guardianapis.com/search?q=debate&amp;tag=politics/politics&amp;from-date=2014-01-01&amp;api-key=test
  https://content.guardianapis.com/search?q=debates&amp;api-key=test
  https://content.guardianapis.com/search?api-key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx
  </code></pre>
  
  <p>All three I can get to via the browser, but when I try to access them via an android app I get the following errors:-</p>
  
  <pre><code>NetworkSecurityConfig: No Network Security Config specified, using platform default
  Error response code: 400
  </code></pre>
  
  <p>I've added this to manifest.xml:-</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  </code></pre>
  
  <p>I also added this to the manifest.xml:-</p>
  
  <pre><code>android:networkSecurityConfig="@xml/network_security_config"
  </code></pre>
  
  <p>And created res/xml/network_security_config.xml, which contains:-</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;network-security-config&gt;
      &lt;domain-config&gt;
          &lt;domain includeSubdomains="true"&gt;content.guardianapis.com&lt;/domain&gt;&gt;
      &lt;/domain-config&gt;
  </code></pre>
  
  <p>Which changes the error to:-</p>
  
  <pre><code>D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
  Error response code: 400
  </code></pre>
  
  <p>I know it's missing:-</p>
  
  <pre><code>&lt;trust-anchors&gt;
      &lt;certificates src="@raw/my_ca"/&gt;
  &lt;/trust-anchors&gt;
  </code></pre>
  
  <p>but I have no idea where or what the certificate would be or if it's needed.</p>
  
  <p>Not really sure what is going on, any help would be appreciated.</p>
  
  <p>IN ADDITION:-
  I am able to connect fine and get the JSON from this URL:-</p>
  
  <pre><code>https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&amp;eventtype=earthquake&amp;orderby=time&amp;minmag=6&amp;limit=10
  </code></pre>
  
  <p>All I get is this:-</p>
  
  <pre><code>No Network Security Config specified, using platform default
  </code></pre>
  
  <p>Buy not error 400 and gets through with a 200 instead. So it makes me think there is something weird going on, but not sure where.</p>