Versions Compared

Key

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

...

Although our response will now be properly packaged up as binary, the client will likely not be able to process the media properly. Should it attempt to display this as a PDF document? Should it attempt to play this as a video? Clients normally need this additional metadata to know how to proceed. Therefore, therefore the Content-Type response header needs to be set with the appropriate IANA media type. There are two ways of doing this. One way is to use the SetResponseHeaderField service and type in the field name (i.e., Content-Type) and field value (e.g., image/jpeg). The easier way is to use the ContentType argument that has been provided with the SetResponseBody service. The following updated code sample uses this latter method:

...