HTTP Router
Overview
Use this Snap to route documents to output views based on the incoming HTTP request method. This Snap is primarily meant for use in Pipelines executed through Triggered Tasks. The Snap matches the HTTP request method used in the Triggered Task and routes the document to the corresponding output view as configured for the request method.
The input data must contain the correct content-type header based on your use case, else your pipeline fails.

Flow-type Snap
Works in Ultra Tasks
Snap views
| View | Description | Examples of upstream and downstream Snaps |
|---|---|---|
| Input | A document containing the data to be processed based on the incoming HTTP request. | |
| Output | If the input document is routed to more than one output views, they are all instances of the same input document. The Pipeline may fail if any downstream Snap attempts to modify the same document without copying it. | |
| Error |
Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:
Learn more about Error handling in Pipelines. |
|
Snap settings
- Expression icon (
): Allows using pipeline parameters to set field values dynamically (if enabled). SnapLogic Expressions are not supported. If disabled, you can provide a static value.
- SnapGPT (
): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
- Suggestion icon (
): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
- Upload
: Uploads files. Learn more.
| Field / Field set | Type | Description |
|---|---|---|
| Label | String | Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline. Default value: HTTP Router Example: HTTP Router |
| Routes | Required. Use this field
set to define/map one output view each to one or more of the request methods
supported. Click |
|
| Request method | String/Expression/ Suggestion |
Select or enter one request method per row, depending on the different HTTP
requests expected from the Triggered task. The following different request methods
are supported:
This field allows an additional value OTHER to handle request methods coming from the Triggered Task that are not configured in this Snap. Default value: N/A Example: GET |
| Output view name | Dropdown list |
Select an output view name from this dropdown list for each Request method selected. Map the value OTHER to an output view that suits your exception-handling requirements. For example, an incoming request method DELETE or HEAD in the overview image is routed to output4 that corresponds to the value OTHER. Tip:
Configure output views beforehand Ensure that the required number of output views are added for the Snap from the Views tab. These output views will then be listed in this field for you to select. Default value: N/A Example: output3 |
| Snap execution | Dropdown list |
Choose one of the three modes in
which the Snap executes. Available options are:
Default value: Validate and Execute Example: Execute only |
Troubleshooting
| Error | Reason | Resolution |
|---|---|---|
| Failed to evaluate expression: _Request_Method. | The expression for the Request Method field contains an invalid pipeline parameter and the Snap cannot process the incoming requests. | Ensure you use the correct spelling for pipeline parameters within the expressions defined in Snap's settings. |
| If your data contains invalid content-type headers or if you pass an incorrect JSON payload, the Snap aborts the pipeline with an error. | When the Snap receives an invalid content-type header in the input, the error appears at the platform level and therefore is not displayed in the Snap Settings dialogue box. | Ensure to pass valid JSON Payload and content-type headers. |