In this video, learn how to unstar a Gist if you no longer want to follow it in the sample app. This is just as easy as the PUT method but instead, a DELETE request is going to be made in order to remove the record.
- [Instructor] Starring a gist did not require…a lot of work for us to implement and unstarring…a gist is just as easy, probably more so now…that we have already taken care of starring…a gist because the processes are almost identical.…Back in the GitHub service interface, copy…the entire star gist by ID method…and paste it below as a new method.…This'll be the unstar gist by ID method.…
And we can leave this as it is except for one thing.…Where we are putting or creating a record…at the URL specified when starring a gist,…we will be deleting the record at the URL…specified in this case.…So we should annotate this method with delete.…Now, in the gist view model class, scroll down…a little bit to our star gist method,…copy all of this code and then scroll a little…bit farther to the un-star gist method…and paste it, making sure to replace…the star gist by ID call with unstar gist by ID.…
And then, in this case, when the response code…is 204 for a success, this means that the gist is unstarred.…So this true should be a false…
- 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.