HTTP Client
In this article
Overview
The HTTP Client Snap is an advanced REST Snap that enables you to send HTTP requests to a server and receive corresponding HTTP responses. It integrates all commonly used HTTP methods, including DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, and TRACE. This Snap allows 50 concurrent connections per route and a total of 500 connections in the pool for all routes.
This Snap uses the Apache HTTP client5 library and strictly follows RFC 3986. According to Section 2.2 of the RFC, all reserved characters in the URI path must be encoded.
Why use HTTP Client Snap in your pipelines?
When integrating APIs and services, you can use either the HTTP Client Snap or the REST Snaps. While both Snaps facilitate HTTP requests, the HTTP Client Snap offers multiple benefits. We highly recommend that you use the HTTP Client Snap instead of the REST Snaps for connecting to REST-based APIs and applications.
Enhanced performance and efficiency
Optimized for faster execution of HTTP requests by supporting efficient bulk processing capabilities.
Asynchronous support for improved throughput and reduced execution time.
Learn more: Example: Send records in a batch using a POST method
Extended protocol and payload support
Supports advanced HTTP methods (for example, PATCH and custom methods).
Better handling of raw HTTP responses and non-standard API interactions with improved support for non-JSON payloads (for example, XML and multipart form-data).
Learn more: Example: Update data in the endpoint using a PATCH method
Greater flexibility and customization
Provides additional control over request construction and modification by supporting a wider range of authentication methods and header configurations.
Enables seamless integration with APIs requiring specific payload formats.
Learn more: Configuring API Suite Accounts
Ideal for comprehensive use cases
Designed for complex integrations that require fine-grained control over HTTP requests.
Designed for scenarios where REST Snaps' predefined configurations are restrictive.
Useful for APIs with non-standard authentication or response structures.
Learn more: HTTP Client Examples
Improved debugging and error handling
Provides detailed logging and troubleshooting options through advanced error-handling and granular retries and timeouts.
Learn more: HTTP Client#Troubleshooting
Pagination support due to its flexibility and configurability
Supports various pagination methods:
Page-based pagination (page or offset parameters in the URL)
Cursor-based pagination (next page token or cursor from API response)
Header-based pagination (pagination information provided in response headers)
Dynamic token extraction: The HTTP Client Snap enables you to dynamically extract the next page token from the API response (headers, body, or even a nested field) and use it in the subsequent request. The REST Snap Pack is more rigid in handling custom pagination mechanisms.
Full control over API calls: You can define the pagination limit, offset, cursor, or token placement directly within the HTTP Client Snap’s request settings. This is useful when working with APIs that require non-standard pagination handling.
Learn more:
Snap Type
The HTTP Client Snap is a Transform-type Snap that transforms the data passed through the HTTP request.
Prerequisites
A valid account with the required permissions.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations
If a Triggered Task Cloud URL is the URI field value in the HTTP Client Snap, then during pipeline validation, repeatedly clicking might cause the pipeline validation to hang. This happens because the HTTP Client Snap is making an API call to trigger the associated pipeline every time the button is clicked.
Workaround: Only click once, then wait for the pipeline validation to stop before clicking the button again.The HTTP Client Snap hides the Authorization headers in the debug information for Basic Authentication and Digest Authentication Accounts because of security considerations.
If you specify the Authorization headers manually in the Snap or through the Secured Headers Account, then the headers are displayed in the debug information, but the values are hidden as follows:
Behavior Change
HTTP Client Snaps in a pipeline no longer share a connection pool; each Snap now maintains its own dedicated pool. This change ensures that SSL certificates are isolated per Snap, following the best practices recommended by Apache HttpClient 5. We recommend that you configure a separate account for each HTTP Client Snap to avoid connection or certificate conflicts.
With 4.41 GA
main31019Snap Pack version, the HTTP Client Snap that uses reserved characters in the Request API might fail, as HttpClient5 library encodes all the reserved characters as part of RFC 3986.We recommend that you select the Prevent URL encoding checkbox to prevent encoding of special characters in the URL and run the pipeline.
With the
main31019version, the HTTP Client Snap does not normalize URLs by default. If you need to normalize a URL, you must perform this as a preliminary step (by replacing double slashes with a single slash in the path) for the URL preparation process.With the
433patches21307update, pagination evaluation occurs before sending the output to the output view. Therefore, ifsnap.out.totalCountis part of the Has next or any other pagination properties, the Snap will not include the count in the output corresponding to the request that produced the output document.
Known Issues
This Snap fails with the
Name may not be nullerror when the key-value pair values are empty for the x-www-form-urlencoded Entity Type.The AWS Sig V4 Account does not support Virtual Private Cloud for the HTTP Client Snap.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
|---|---|---|---|---|
Input | Binary or Document
|
|
| Each input document includes one of the following:
|
Output | Binary or Document
|
|
| Each output document contains one of the following:
|
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:
When you select the Enable debug checkbox, the information about the executed request and response is written to the error view in case of errors. Learn more about Error handling in Pipelines. | |||
Snap Settings
Asterisk ( * ): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon ( ): Indicates that you can add fields in the field set.
Remove icon ( ): Indicates that you can remove fields from the field set.
Upload icon ( ): Indicates that you can upload files.
Field Name | Field Type | Field Dependency | Description | ||
|---|---|---|---|---|---|
Label*
Default Value: HTTP Client | String | None. | Specify a unique name for the Snap.
| ||
Request Method*
Default Value: GET | String/Expression/Suggestion | None. | Specify a custom method or choose one of the following HTTP request methods:
| ||
URI*
| String/Expression | None. | Specify the service endpoint URL of the REST API. You can provide the URL in one of the following ways:
You can use the canonical name (CNAME) for the URI, so it's not necessary for the URL to end with The Snap finds the value at the JSON path "$.widget.id" in the input data and replaces "%s" in the URL with the value. You can connect the File Reader and JSON Parser Snaps upstream of the HTTP Client Snap and prepare the following JSON file to the File Reader Snap: [
{ "widget": { "id": "111", "name": "foo" } }
{ "widget": { "id": "555", "name": "bar" } }
]
"https://www.example.com/data/v27.0/sobjects/Account"The URL for this Snap must be valid. If the URL contains any special characters, such as
We recommend that you use the former (encodeURIComponent) method to escape the special characters. | ||
Query Parameters | Use this field set to add query parameters to be included in the request. This is optional and can either be defined directly in the URL, as separate parameters or both. | ||||
Parameter Name Default Value: N/A | String/Expression | N/A | Specify the name of the query parameter.
| ||
Parameter Value Default Value:N/A | String/Expression | N/A | Specify the value to assign to the parameter. | ||
HTTP Headers | Use this field set to create the HTTP header key-value pairs required for defining the headers for different types of input (JSON, PDF, DOCX, and so on). If you want to specify only content-type headers, you can configure the Multipart Content-Type property instead. | ||||
Header Name
| String/Expression/Suggestion | N/A | Specify the name of the HTTP header. Alternatively, select one of the following options from the suggestion list:
This Snap accepts default value | ||
Header Value Default Value: N/A | String/Expression | N/A | Specify the value for the HTTP header. | ||
Enable debug
| Checkbox | N/A | Select this checkbox to include the information about the executed request and response in the output document (under the
Using debug mode increases memory usage because of the retention of historical requests. So, for long-running or large input pipelines, we recommend you to deselect the Enable debug checkbox to avoid memory issues. | ||
Use form encoding for spaces
Default Value: Deselected | Checkbox | N/A | Select this checkbox to enable the Snap to encode any space characters in query parameters using the plus sign (+). By default, the Snap encodes space characters using percent-encoding ( after encoding, the URI will be: Selecting this checkbox preserves whatever encoding has already been made. So, if you place a plus symbol in the query portion URL or percent-encodes ( Learn more about encoding of query parameters. | ||
Prevent URL encoding
Default Value: Deselected | Checkbox | N/A | Select this checkbox to prevent the Snap from automatically URL-encoding of the input URI. Enable this setting to use an already encoded URI. URL encoding encodes the same character in different encodings based on its location within the URL. The specific segments of the URL that apply here are the PATH portion and the QUERY portion: When you deselect this checkbox, the following are some of the characters that are automatically encoded by the Snap: Better Code Block | ||
HTTP Entity | An HTTP entity is the message body you can send in a request or receive from a response. An entity represents both binary and character content. The POST and PUT methods use entities. | ||||
Entity Type
| Dropdown list | N/A | Choose one of the following entity types to include in the request body.
| ||
Multipart Subtype
| String/Expression | Appears on selecting multipart for Entity Type. | Specify the MIME subtype for multipart, which specifies the nature of the message parts and their interrelationship. | ||
Multipart Form | Appears on selecting multipart for Entity Type. Use this field set to configure the fields required to upload multiple files and text. Learn more about Multipart Upload. By default, the Snap Settings display the fields required to upload a file. The data that is sent to the server using this entity type uses the following encoding pattern:
| ||||
Type
| Dropdown list | Appears on selecting multipart for Entity Type. | Choose either of the following multipart types to initiate the upload:
| ||
Key
| String/Expression | Appears on selecting multipart for Entity Type. | Specify the key for the multipart form-data needed to upload a file. The HTTP Client uses multipart entity to achieve the file upload. The form-data of its multipart entity contains key-value pairs. Upload and multipart file key depend on the service endpoint. | ||
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2025 SnapLogic, Inc.