Can anyone explain why this peace of code is not working? I checked everything as in some sample online and I have the feeling I am missing something. Thanks!
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));
}
});
As far as I see the first error is the space in the URL: This:
client.get(" http://10.0.0.89/Data/D", params, new AsyncHttpResponseHandler()
To this:
client.get("http://10.0.0.89/Data/D", params, new AsyncHttpResponseHandler()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With