title: Strange problems with the Spring RestTemplate in Android application
body: <p>I began to use RESTful api of the Spring Framework in my android client application. But I have encountered with problems when I tried to execute HTTP request via postForObject/postForEntity methods. Here is my code:</p>
  
  <pre><code>public String _URL = "https://someservice/mobile/login";
  public void  BeginAuthorization(View view)
  {     
          HttpHeaders requestHeaders = new HttpHeaders();
          requestHeaders.setContentType(MediaType.APPLICATION_JSON);
           HttpEntity&lt;String&gt; _entity = new HttpEntity&lt;String&gt;(requestHeaders);
          RestTemplate templ = new RestTemplate();
          templ.setRequestFactory(new HttpComponentsClientHttpRequestFactory());
          templ.getMessageConverters().add(new MappingJacksonHttpMessageConverter());
          ResponseEntity&lt;String&gt; _response = templ.postForEntity(_URL,_entity,String.class); //HERE APP CRASHES
          String _body = _response.getBody();
  </code></pre>
  
  <p>So the question what am I doing wrong? How to fix this? May there is other way to do it?<p>I really need a help. Thanks in advance!</p>