There will be times when you will need to change the way the data converter behaves. For instance, if a date value is in a non-standard format. In these cases, you can customize the data converter and tell Retrofit to use the modified converter instead.
- [Instructor] Depending on the API you're communicating…with, the default behavior of the data converter you…are using with Retrofit might not work precisely…the way you need it to.…The great thing about Retrofit is that if something…doesn't do exactly what you want it to do,…you can change it.…We did this in Chapter Four when we added…a custom interceptor to the OkHttp client…that added an authorization header to every request.…We can do the same thing with the data converter,…Gson, in the case of the sample application.…
The GitHub API is a poor example…of a case where we may need to do this.…It adheres to almost every REST standard.…So, the default behavior of the API matches…the default behavior of our Retrofit implementation.…This won't always be the case.…For instance, there are a lot of different ways…to format date and time data.…This is something you should always pay close attention…to when working with web APIs.…The format at a particular date time…is written in can vary from application to application.…
- REST API basics
- Methods for reading and writing data
- Defining data models with Retrofit
- Implementing an API interface
- Getting data with a Retrofit call
- Authorizing requests
- Putting, deleting, and posting data
- Customizing the data converter
- Working with the request and response headers
Skill Level Intermediate
Android App Development: Enterprise Integrationwith Jon-Luke West47m 51s Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
1. HTTP APIs
2. Get Started with Retrofit
3. Finish the Sample App
4. More Configuration Options
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.