Created
January 28, 2017 03:18
-
-
Save novasdream/8a76482102446b8aa5258762b0d952a6 to your computer and use it in GitHub Desktop.
This file contains 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
```java | |
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); | |
logging.setLevel(HttpLoggingInterceptor.Level.BODY); | |
OkHttpClient.Builder httpClient = new OkHttpClient.Builder(); | |
httpClient.addInterceptor(logging); // <-- this is the important line! | |
retrofit = new Retrofit.Builder() | |
.baseUrl(getResources().getString(R.string.serverUrl)) | |
.addConverterFactory(GsonConverterFactory.create(gson)) | |
.client(httpClient.build()) | |
.build(); | |
api = retrofit.create(PROJETOAPI.class); | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment