i am trying to call certain API, which is working fine if i test it on laptop(postman) but when i use it in my app its gives exception.
RequestParams params = new RequestParams();
params.add("comapanyName",jsonObject.getString("company_name"));
AsyncHttpClient asyncHttpClient = new AsyncHttpClient();
asyncHttpClient.addHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
asyncHttpClient.post(url, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
String s = new String(responseBody);
Log.i("RESPONSE_INSERT", s);
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
Log.i("RESPONSE_ERROR_I", e.getMessage());
}
});
Its not local API but on server