Retrofit supports multipart HTTP requests when the @Multipart and @Part annotations are added to the method definition. Each part is serialized using the default converter or a converter appropriate to the data type that has been added to the Retrofit instance.
- [Instructor] Certain APIs will require you…to send data to it in multiple parts, or segments,…instead of as a single package.…If you have worked on front-end web development at all…you may have come across something like this before.…This performs what is called a multi-part request,…which breaks a post request up into a series…of smaller requests, one for each field or part.…This is particularly useful when dealing with files,…like uploading an image to a server.…
Let's go back over to Android Studio…to see what this might look like if we were able…to upload a picture to our user account…using the GitHub API.…In the GitHub Service Interface,…scroll down,…and let's define a new method that returns a call,…wrapping a GitHub user.…We'll call this uploadPictureToUser.…
This method will take two parameters.…Because each of these parameters…is being sent as a separate request,…they will need to be serializable…by the data converter you are using.…Or, you should use a RequestBody…so you can handle the data encoding yourself.…
- 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.