Skip to content

Instantly share code, notes, and snippets.

@novasdream
Created January 28, 2017 03:18
Show Gist options
  • Save novasdream/8a76482102446b8aa5258762b0d952a6 to your computer and use it in GitHub Desktop.
Save novasdream/8a76482102446b8aa5258762b0d952a6 to your computer and use it in GitHub Desktop.
```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