Created
May 31, 2017 15:26
-
-
Save abdallaadelessa/cbd5ca6f576581a2406b7275f6f761af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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