title: Cannot connect to localhost API from Android app
body: <p>I am new to Django. I have created an API named <code>http://127.0.0.1:8000/api/update/1/</code> and it works perfectly in the browser and on the Postman app. </p>
  
  <p>However, when I am trying to access the API from the Android app it is returning NULL. </p>
  
  <p>The android code works when the API is the following.</p>
  
  <pre><code>http://newsapi.org/v1/articles?source=bbc-news&amp;sortBy=top&amp;apiKey=8190df9eb51445228e397e4185311a66
  </code></pre>
  
  <p>However, it does not work when the API is the following, even if the following API works just fine from my browser running in the same PC and from the Postman application. </p>
  
  <pre><code>http://127.0.0.1:8000/api/update/1/
  </code></pre>
  
  <p>I am attaching the code where API call is made.</p>
  
  <pre><code>protected String doInBackground(String... args) {
      String xml = "";
      String api = "http://127.0.0.1:8000/api/update/1/"; // returns NULL works in Postman app and in the browser
      // String api = "http://newsapi.org/v1/articles?source=bbc-news&amp;sortBy=top&amp;apiKey=8190df9eb51445228e397e4185311a66"; // works in all places
      String urlParameters = "";
      xml = Function.excuteGet(api, urlParameters);
      return  xml;
  }
  </code></pre>
  
  <p>Can anyone help me with this? Thanks in advance. </p>