1

The library worked perfect for me until i got this problem yesterday. I tried for version 1.4.5 and 1.4.8.I tested on real device, emulator. I also created a new project, doing only connects to Google:

AsyncHttpClient client = new AsyncHttpClient();
client.get("https://www.google.com", new AsyncHttpResponseHandler() {

    @Override
    public void onSuccess(int statusCode, Header[] headers, byte[] response) {
        // called when response HTTP status is "200 OK"
        Log.e("TEST", new String(response));
    }

    @Override
    public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {
        // called when response HTTP status is "4XX" (eg. 401, 403, 404)
    }
});

And response : �����������������}iw۶���� �����H-�%��q�7q����������bL�4IyS������$A����<�9�S7"v����6x�f�Vz�9�I��{���N�Xa����<��P&i� ��Ě8�m�����o��( �N]Cq� ��P{�qऴa��ԙ��r��ؚ4҉Ӹ c��H��t���M�pJ�c�3ۛ��+nj��������l'L�tj7�0vZ��a����/M����4�ȱ<�7��Mg��4Ұ1q�q���c��9��J��Մ����; ?ϱB���4�4���Nb�^�0)�&L�Ў��qh�i����an�³1�� �L�춢��Q��ad(,!�O��w�x�����1�b�9�M-���ί���U��l����������`��Ϣ���{����Ӄ Help me, thanks

Thuan Bui
  • 43
  • 5

1 Answers1

2

It is known issue in AsyncHttpClient (see https://github.com/loopj/android-async-http/issues/932). You can disable gzip as a temporary workaround:

AsyncHttpClient client = new AsyncHttpClient();
client.addHeader("Accept-Encoding", "identity"); // disable gzip
client.get(...)
SergeyA
  • 4,427
  • 1
  • 22
  • 15