Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In our What is a resource? article, we noted that a resource can be represented by various media types. This includes Most of the time this will be text based media (e.g., HTML, JSON, XML) and binary media (e.g., JPEG images, PDF documents, Compressed files). . However, perhaps you need to return binary media, such as:

  • A PDF version of a customer invoice.
  • A JPEG image of a barcode.
  • An MPEG video of assembly instructions.

This article will explain how to properly return binary data in your API.