title: How to use loopj-async-http android library on Intentservice?
body: <p>I am trying to create connections using the SyncClient provided with </p>
  
  <p><a href="https://github.com/loopj/android-async-http" rel="nofollow">https://github.com/loopj/android-async-http</a></p>
  
  <p>I am not able to connect to my Webservice, it shows me the following logs</p>
  
  <pre><code>12-05 19:54:45.397: W/System.err(3836): org.apache.http.client.ClientProtocolException
  12-05 19:54:45.397: W/System.err(3836):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)
  12-05 19:54:45.397: W/System.err(3836):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
  12-05 19:54:45.397: W/System.err(3836):     at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:75)
  12-05 19:54:45.397: W/System.err(3836):     at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:94)
  12-05 19:54:45.397: W/System.err(3836):     at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:56)
  12-05 19:54:45.397: W/System.err(3836):     at com.loopj.android.http.SyncHttpClient.sendRequest(SyncHttpClient.java:66)
  12-05 19:54:45.407: W/System.err(3836):     at com.loopj.android.http.AsyncHttpClient.get(AsyncHttpClient.java:340)
  12-05 19:54:45.407: W/System.err(3836):     at com.loopj.android.http.AsyncHttpClient.get(AsyncHttpClient.java:329)
  12-05 19:54:45.407: W/System.err(3836):     at net.connectedu.service.AlarmService.checkAppStatus(AlarmService.java:151)
  12-05 19:54:45.407: W/System.err(3836):     at net.connectedu.service.AlarmService.doWakefulWork(AlarmService.java:146)
  12-05 19:54:45.407: W/System.err(3836):     at com.commonsware.cwac.wakeful.WakefulIntentService.onHandleIntent(WakefulIntentService.java:108)
  12-05 19:54:45.407: W/System.err(3836):     at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
  12-05 19:54:45.418: W/System.err(3836):     at android.os.Handler.dispatchMessage(Handler.java:99)
  12-05 19:54:45.418: W/System.err(3836):     at android.os.Looper.loop(Looper.java:137)
  12-05 19:54:45.418: W/System.err(3836):     at android.os.HandlerThread.run(HandlerThread.java:60)
  12-05 19:54:45.418: W/System.err(3836): Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'https://localhost/api/get_logs/lalith/'
  12-05 19:54:45.427: W/System.err(3836):     at org.apache.http.impl.client.DefaultRedirectHandler.getLocationURI(DefaultRedirectHandler.java:173)
  12-05 19:54:45.427: W/System.err(3836):     at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:923)
  12-05 19:54:45.437: W/System.err(3836):     at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:475)
  12-05 19:54:45.437: W/System.err(3836):     at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
  12-05 19:54:45.437: W/System.err(3836):     ... 14 more
  </code></pre>
  
  <p>What would be the possible reasons for this ? does the synchronous library in loopj works fine ? </p>