Sign in Go Pro

RetroFit2

Modifying Request URLs and Headers with OkHttp

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson

Up next

Previous

About

In this lesson we’ll review how to modify your Retrofit 2 requests using OkHttp. Retrofit ships with the ability to add headers to individual requests. However, if you want to add headers to every request, then it’s recommended that you use an OkHttp Interceptor. In this lesson you will learn : - What a network interceptor is - What an application interceptor is - How to add an application interceptor to add a header value - How to add an application interceptor to add a query string parameter # Code - [Sample Code](https://github.com/adavis/adept-android/tree/retrofit2-modifying-urls)

Instructor

Links

Lessons in RetroFit2