I am new to the Robospice/retrofit libraries. I got some samples from the github. https://github.com/octo-online/RoboSpice-samples/tree/release/robospice-sample-retrofit.
My Understanding:
The request is "githubRequest" and the response is the "Contributor.List". The webservice is called by getSpiceManager().execute.
Code Snippet:
@Override
protected void onStart() {
super.onStart();
getSpiceManager().execute(githubRequest, "github", DurationInMillis.ONE_MINUTE, new ListContributorRequestListener());
}
public final class ListContributorRequestListener implements RequestListener<Contributor.List> {
@Override
public void onRequestFailure(SpiceException spiceException) {
Toast.makeText(SampleSpiceActivity.this, "failure", Toast.LENGTH_SHORT).show();
}
@Override
public void onRequestSuccess(final Contributor.List result) {
Toast.makeText(SampleSpiceActivity.this, "success", Toast.LENGTH_SHORT).show();
updateContributors(result);
}
}
My Question: I want to check from the app, whether the request/response("githubRequest"/"Contributor.List") correct JSONs are sent to the service. So How can I sysout the JSON request and response. But the request/response are POJO object. But If I want to print the JSON request and response, How can I do that? Anybody help me to do this?