title: HttpURlConnection not connecting
body: <p>I am making a HttpUrlConnection with an Usgs API. This is my Url: </p>
  
  <p>"<a href="https://earthquake.usgs.gov/fdsnws/event/1/queryformat=geojson&amp;eventtype=earthquake&amp;orderby=time&amp;minmag=6&amp;limit=10" rel="nofollow noreferrer">https://earthquake.usgs.gov/fdsnws/event/1/queryformat=geojson&amp;eventtype=earthquake&amp;orderby=time&amp;minmag=6&amp;limit=10</a>"</p>
  
  <p>After thoroughly debugging, it seems that after connection.connect connection fails and jsonResponse is empty.</p>
  
  <pre><code> public static String makeHttprequest(URL url) throws IOException {
          String jsonResponse = "";
          HttpURLConnection connection = null;
          InputStream stream = null;
          try {
              connection = (HttpURLConnection) url.openConnection();
              connection.setRequestMethod("GET");
              connection.setReadTimeout(1000000);
              connection.setConnectTimeout(1500000);
  
              connection.connect();
  
              stream = connection.getInputStream();
              jsonResponse = readfromstream(stream);
  
          } catch (IOException e) {
              Log.e("IOException", "Error while making request");
          }
  
          return jsonResponse;
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/R0qfH.png" rel="nofollow noreferrer">This is Log</a></p>