Retrofit 2 — Access Mapped Objects and Raw Response Payload

Retrofit has the fantastic capability of automatically mapping server responses, no matter if XML, JSON or protocol buffers, to Java objects. This is super convenient for us developers. Of course, if you want, you can always skip the mapping and work with the raw server response.

However, in rare cases it might be necessary to access both — the mapped objects and the raw server response. Because this is actually more difficult than you'd think, we'll spend the next few minutes explaining every step in detail.

Retrofit Series Overview

  1. Introduction to Call Adapters (Coming soon)
  1. Callbacks (Coming soon)
  2. Annotations (Coming soon)
  3. Fluent Interface with Builders (Coming soon)


Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.
Enroll to receive exclusive content and value right away or sign in if you’re already a Future Student.

Enroll me for $12/mo

Explore the Library

Find interesting tutorials and solutions for your problems.

Miscellaneous