Skip to content

Instantly share code, notes, and snippets.

@bangiqi
Created January 24, 2017 08:50
Show Gist options
  • Save bangiqi/6e91ef9140c620ebf07187247e32663d to your computer and use it in GitHub Desktop.
Save bangiqi/6e91ef9140c620ebf07187247e32663d to your computer and use it in GitHub Desktop.
Gson gson2 = new Gson();
DataSurveyFasilitator a = gson2.fromJson (keySurvey, DataSurveyFasilitator.class);
Log.d(TAG, "hasil add json aja: "+gson2.toJson(a));
Call<DataSurveyFasilitator> call = service.postSurvey(a);
// Asynchronously execute HTTP request
call.enqueue(new Callback<DataSurveyFasilitator>() {
@Override
public void onResponse(Call<DataSurveyFasilitator> call, Response<DataSurveyFasilitator> response) {
// http response status code + headers
System.out.println("Response status code: " + response.code());
System.out.println("response body aja : "+new Gson().toJson(response.body()));
// isSuccess is true if response code => 200 and <= 300
.....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment