D
D
Dmitry Chizhov2014-12-25 23:41:31
Android
Dmitry Chizhov, 2014-12-25 23:41:31

SyncHttpClient not working?

Help plz. SyncHttpClient calls onFailure(). there is emptiness in it. those. response = null, header = null, status = 0. I just can't figure out what I don't like.
I use the loopj SyncHttpClient library (not AsyncHttpClient. I need a synchronous request)

import com.loopj.android.http.SyncHttpClient;

        SyncHttpClient client = new SyncHttpClient();
        RequestParams params = new RequestParams();
        params.put("par", value);
        client.post(request_uri, params, new JsonHttpResponseHandler() {
            @Override
            public void onSuccess(int i, Header[] headers, org.json.JSONObject response) {
                
            }
        });

At the same time, AsyncHttpClient with all the same parameters works successfully.
Well tell me at least something. The third day I break my head, I can’t sleep at night, a piece does not climb into my throat. All about the request I think.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question