Skip to content

Instantly share code, notes, and snippets.

@abdallaadelessa
Created May 31, 2017 15:26
Show Gist options
  • Select an option

  • Save abdallaadelessa/cbd5ca6f576581a2406b7275f6f761af to your computer and use it in GitHub Desktop.

Select an option

Save abdallaadelessa/cbd5ca6f576581a2406b7275f6f761af to your computer and use it in GitHub Desktop.
public interface DataService {
@Headers({
"Accept: application/json",
"Content-Type: application/json",
"User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
})
@GET("reviews.json?count=5&page=0&rating=0&sortBy=date_of_review&direction=DESC")
Call<ReviewResponse> listData();
}
private void doWithRetrofit() {
Retrofit retrofit = new Retrofit.Builder()
.baseUrl("https://www.getyourguide.com/berlin-l17/tempelhof-2-hour-airport-history-tour-berlin-airlift-more-t23776/")
.addConverterFactory(GsonConverterFactory.create())
.build();
DataService service = retrofit.create(DataService.class);
service.listData().enqueue(new Callback<ReviewResponse>() {
@Override
public void onResponse(Call<ReviewResponse> call, Response<ReviewResponse> response) {
Log.i("","");
}
@Override
public void onFailure(Call<ReviewResponse> call, Throwable t) {
Log.i("","");
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment