title: Connecting to a web server via HttpClient
body: <p>I'm trying to connect to REST web server and I don't know what is going wrong. The code that connects is:</p>
  
  <pre><code>public List&lt;Agenda&gt; getAgenda(String dia) {
      try {
          Log.i(TAG, "It is inside getAgenda()");
          HttpClient client = new DefaultHttpClient();
          HttpGet method = new HttpGet(Settings.getServiceUrl() + "/" + dia);
          Log.i(TAG, Settings.getServiceUrl() + "/" + dia);
          //the line above prints: http://192.168.0.100/odonto/agenda.php/2012-02-01
          HttpResponse resp = client.execute(method);
          //return loadFromJSONArray(client.execute(method));
          Log.i(TAG, "Recebeu a response");
          return loadFromJSONArray(resp);
      } catch (Exception e) {
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>
  
  <p>Well, here is the thing: the line </p>
  
  <pre><code>Log.i(TAG, Settings.getServiceUrl() + "/" + dia);
  </code></pre>
  
  <p>prints on the debug window correctly. But the line:</p>
  
  <pre><code>Log.i(TAG, "Recebeu a response");
  </code></pre>
  
  <p>don't prints. So the problem is in line:</p>
  
  <pre><code>HttpResponse resp = client.execute(method);
  </code></pre>
  
  <p>But I really don't know how can this be wrong!! I've already tested the REST server with Firefox and it works just fine! The debug window with a filter to show just the tag System.err is in the link:</p>
  
  <p><img src="https://i.stack.imgur.com/NDx5N.png" alt="enter image description here"></p>