You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

In our What is a resource? article we noted that a resource is digital content which can be represented by various media types. Most of the time this will be text based media (e.g., HTML, JSON, XML). However, there will be situations when the resource needs to be represented by binary media. Here are a few possible use cases:

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

The SRP HTTP Framework includes a routine called Picture_API, which includes logic that returns the graphic images associated with a specified contact. This article will break it down into the two basic steps.

Step One: Load the binary data into a variable.

Typically this will be done using the OSRead statement. Here is the relevant code from the Picture API:

OSRead PictureBinary from PicturePath then
    // Other logic goes here.
end



  • No labels