Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added screenshot to align with https://community.snaplogic.com/t/settings-a-http-response-code-for-triggered-tasks/8285/3

Supported HTTP Methods

...

Pipeline Design for GET Requests

Triggered Tasks support viewing the output of a Pipeline. When you execute a Pipeline using a Triggered Task URL, the output can be included as response to the HTTP request. You can create a Pipeline to be used in this manner by leaving one output view unconnected.   For For example, a Pipeline that consists solely of only a File Reader Snap would return the contents of the file when the Task URL is requested.  

This feature works with both document and binary views.  

  • Document view: The response consists of a JSON-encoded array of each document read from the view. If the output document contains a field called status that is an integer, it is treated as the HTTP response status code. You can use a Document to Binary Snap as the final Snap in the Pipeline. Add a  Binary Header with the field status and its value an HTTP response status code, as shown below:

    Image Added
  • Binary stream: The binary data's header is sent back to the client as the HTTP response header. The body of the binary data is directly streamed back to the client. You can use a formatter Snap, like the XML or CSV Formatter Snaps, to transform the output of a document view into a binary view if the default JSON-encoding does not work.


Pipeline Design for POST Requests

...