LoopJ AndroidAsyncHttp error

Can someone explain why this world of code isn't working? I have tested everything as in some examples online and I have a feeling that I am missing something. Thank!

                    RequestParams params = new RequestParams();
                    params.put("d", dataVarAll);

                    AsyncHttpClient client = new AsyncHttpClient();

                    client.get(" http://10.0.0.89/Data/D", params, new AsyncHttpResponseHandler()
                    {

                        @Override
                        public void onStart() {
                            // called before request is started
                            consoleText.setText("Start...");
                        }

                        @Override
                        public void onRetry(int retryNo) {
                            // called when request is retried
                            consoleText.setText("Retry");
                        }

                        @Override
                        public void onFailure(int arg0, Header[] arg1, byte[] arg2, Throwable arg3) {
                            // TODO Auto-generated method stub
                            consoleText.setText(new String(arg2));
                            Log.v("FAILURE: ", (new String(arg2)));
                            //consoleText.setText(arg1.toString());
                        }

                        @Override
                        public void onSuccess(int arg0, Header[] arg1, byte[] arg2) {
                            // TODO Auto-generated method stub
                            consoleText.setText(new String(arg2));
                        }
                    });

      

+3


source to share


1 answer


As far as I can see, the first error is a space in the url: This:

client.get(" http://10.0.0.89/Data/D", params, new AsyncHttpResponseHandler()

      



For this:

client.get("http://10.0.0.89/Data/D", params, new AsyncHttpResponseHandler()                    

      

+2


source







All Articles