Join Jon-Luke West for an in-depth discussion in this video Make a HEAD request, part of Android Development: Retrofit with Java.
- [Instructor] When we load the details of a gist…we also want to load the comments posted to that gist.…The GitHub API will return the list of comments,…starting with the oldest comments added to the gist,…which is not what we want to show to the user.…The most recent comments are the most important to us.…So, we need to flip this list around…and load it using the last page first…and going backwards from there, to the first page.…
To do this, we need to figure out…how many pages there are first.…Because the GitHub API includes page information…in the headers of the response,…we can tell it that we don't care…about the body of the response with a head request,…instead of a get request.…Making the request execute much faster.…Let's go back to Android Studio…and open up the I GitHub Service interface.…And we need to define two methods for this.…
The first one is pretty straightforward.…A method that returns a call,…wrapping a list of gist comments…that will be called getgistcommentsbyid.…Let's get rid of this little box here.…
- 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.