I have a set of the params, entered by the user and stored here:
RequestParams params = new RequestParams();
params.put("confirmPass", confirmPass);
params.put("username", email);
params.put("password", password);
Then I instantiate the AsyncHttpClient and implement the required methods:
AsyncHttpClient client = new AsyncHttpClient();
client.get(url, params, new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
Toast.makeText(getApplicationContext(), "Failed", Toast.LENGTH_LONG).show();
}
});
How can I POST the params stored in the body of the request (I am using a server (mocky.io) to mock the whole process)?