tHTTPClient Standard properties
These properties are used to configure tHTTPClient running in the Standard Job framework.
The Standard tHTTPClient component belongs to the Internet family.
The component in this framework is available in all subscription-based Talend products.
- This component is available only when you have installed the 8.0.1-R2023-05 Talend Studio monthly update or a later one delivered by Talend. For more information, check with your administrator.
- As of today, it is recommended to use the tHTTPClient component over the tRESTClient component.
Basic settings
Property type |
Either Built-in or
Repository
.
|
Guess schema | Click this button to retrieve the schema according to your settings. This
button works when Status, headers and body is selected from
the Returned content drop-down list or Output
key/value pairs is selected and key/value pairs are set in the
table under the Output key/value pairs option. When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. Information noteNote: An error occurs if
you click this button while Body is selected from the
Returned content drop-down list and JSON is selected from the Response body
format drop-down list. This is because the component is designed
to generate the schema according to the input configuration only and to prevent
the HTTP query execution from consuming or updating data.
|
Schema and Edit Schema | A schema is a row description, it defines the number of fields to be
processed and passed on to the next component. The schema is either
Built-in or stored remotely in the
Repository.
The component generates the schema automatically according to the related settings of the component. However, you need to define the schema manually if you select Body from the Returned content drop-down list and JSON from the Response body format drop-down list. In this case, you need to add a column for each of the first-level attributes and set the column type to String for attributes with nested JSON objects. Here is an example. With JSON selected
from the Response body format drop-down list and
Body selected from the Returned
content drop-down list, the schema needs to have a column of the
String type to hold the content of the
address node of the following JSON object in the
response.
You need to add these columns in the schema: id (type Int), name (type String), and address (type String). The component can then extract zipcode from the address column using Data Shaping Selector Language (DSSL) (for example, input.address.zipcode). By default, the columns in the schema depend on the settings of the Response body format and the Returned content options as follows.
When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. Click Edit schema to make changes to the schema. If the current schema is of the Repository type, three options are available:
|
Sync columns | Click this button to retrieve the schema from the preceding component. |
Base URL | Type in the base URL address of the HTTP server you want to access, for
example, https://www.example.com/v1.0/. To access a Web
service provided by an HTTP server, you need to provide both the base URL address
and the path. You can provide the path in the Path field.
You can also define a placeholder using the Data Shaping Selector Language syntax to have some parts dynamically filled with the value extracted from the incoming record. Example: Base URL = "https://{.input.job_url}" and Path = "{.input.job_url_path}" |
Authentication type |
Select one of the following authentication methods depending on the server
security requirements:
Information noteNote: To enter a password, a token, or a client secret key, click the [...] button next to the corresponding field to bring
out the Enter a new password dialog box, enter the
password, the token, or the secret key in the text field, and click
OK. Note that you can enter either a JSON string in
the pure password mode or a Java expression in the
Java mode. You can toggle between the two modes by
clicking switch to Java mode or switch to
pure password mode on the top of the text
field.
|
HTTP method | Select one of these HTTP methods to specify the action to be performed:
GET, POST,
HEAD, OPTIONS,
PUT, PATCH,
DELETE, or TRACE. To select an HTTP method, click the [...] button next to this field and select the desired HTTP method in the dialog box that appears. |
Path | Enter the second part of the URL in order to complete the base URL filled in
the Base URL field. Base URL and Path are joined with the
character / when needed. For example, to search data from the
server with the URL of https://jira.talendforge.org/rest/api/2/,
type in search in this field. Refer to the description on the Base URL field for related information. You can also define a placeholder using the Data Shaping Selector Language syntax to have some parts dynamically filled with the value extracted from the incoming record. Example: Base URL = "https://{.input.job_url}" and Path = "{.input.job_url_path}" |
Path parameters | Select this check box to specify extra parameters needed to complete the
base URL or the path in the form of name-value pairs. If the base URL or path contains placeholders, you can add parameters in this table and set the parameter name and parameter value in the following way to replace the placeholders.
For example, with the base URL https://www.example.com and the path /{api_version}, you can set the path by adding a parameter in this table, setting Name to api_version and Value to v1.0. |
Query parameters | Select this option to specify the parameters that will be set in the query
URL after the ? character in the form of
name=value. The values are automatically encoded.
Example: Query parameter name = entityId and query parameter value = UUID-1234567 |
Request headers | Select this option to define some HTTP request headers as name-value pairs.
You can define each header to be either part of the main HTTP query
(Main), the authentication query
(Authentication, only available with OAuth
2.0 authentication), or both queries (Both).
Example: Header name = Content-Type and header value = text/html;charset=utf-8 |
Request body | Select this option if you want to include a message body in the request. |
Body type | Set the body type by selecting the corresponding option from the drop-down list.
The Body type drop-down list is available when you select the Request body option. |
Response body format | Select the response body format from the drop-down list. The right format
allows the connector to parse and apply operations to the response. Currently,
text and JSON formats are supported.
When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. |
Returned content | Select one of the following two options depending on the data returned by
the server.
When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. Information noteNote: This option impacts
the schema of the output flow of this component. It is recommended to update
the schema by clicking the Guess schema button after
selecting an item from this drop-down list.
|
Extract a sub-part of the JSON | Enter the path of a node to select a sub-element of the response. If the
element is an array, each element of the array will be looped over. For more
information about the syntax for entering the node name, see Data Shaping Selector Language syntax.
This field is optional and must remain empty to retrieve the entire JSON response. Example for the following JSON document:
When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. This field is available if you select JSON from the Response body format drop-down list. Information noteNote: This field impacts the schema
of the output flow of this component. It is recommended to update the schema by
clicking the Guess schema button after setting this
field.
|
Output key/value pairs | Select this option to return key/value pairs instead of the raw body of the
HTTP response. To enter a value for a node, add a row in the table by clicking the
plus button under the table, enter the name of the node in the
Name field, and enter the value in the
Value field. The value can be from the component input or from the HTTP response. Enter "{.input.<dssl_path>}" in the Value field if the value is from the component input or "{.response.<dssl_path>}" if the value is from the HTTP response. In the example for the Extract a sub-part
of the JSON option, you can retrieve the name and city values of
the geologists by entering .content in the
Extract a sub-part of the JSON field and adding the
following two key/value pairs in the table.
When retrieving data from an HTTP server, you can specify the format and content of the data retrieved using the schema, the Guess schema button, the Response body format option, the Returned content option, the Extract a sub-part of the JSON option, and the Output key/value pairs option. For more information, see tHTTPClient: configuration and output. Information noteNote: This option impacts
the schema of the output flow of this component. It is recommended to update
the schema by clicking the Guess schema button after
setting the key/value pairs in the table under this option.
|
Forward input values | Select this option to pass the values received from the component input to
the subsequent component. This option is available when Output key/value pairs is selected. |
Download attachments | Select this option to save the attachments of the response as a file in a
specified directory. You need to type in the path to the directory in the
Directory to save field. If the directory specified does
not exist, the component will try to create it. Make sure you have the permission
to write the directory specified. For a MIME multipart response with attachments, the first part that is not an attachment in the body will be treated as the output record body; the attachment part is marked with Content-Disposition=attachment;... header and the attachment filename is taken from its `name=...` value. If the name field is not provided in header metadata, the file will be named using the service name (that is, the Path value). If no part has the Content-Disposition=attachment header, the first part of the multipart is treated as the body for the output record and other parts are treated as the attachments. For binary files, the tHTTPClient component will save the HTTP response body into a file as is. If there is no name specified in the Content-Disposition header, the result file will be named after the resource name with a _0 suffix. Information noteNote: This option is available only
when you have installed the 8.0.1-R2023-05 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.
|
Advanced settings
tStatCatcher Statistics | Select this check box to gather the Job processing metadata at a Job level and at each component level. |
Connection timeout (ms) | Set the timeout period (in milliseconds) for the connector to establish a connection to the server. An error occurs if an attempt to establish a connection fails. |
Receive timeout (ms) | Set the timeout period (in milliseconds) for receiving response data. An error occurs if no data is received when the read timeout period expires. |
Bypass server certificate validation | Select this option to prevent the client from validating the server
certificate. This option is not recommended in production environments. |
Use a proxy | Select this option to use an HTTP or a SOCKS proxy.
|
Retry with exponential backoff | Select this option to automatically retry failed HTTP calls. If selected,
HTTP calls are retried if there is a connection error, a timeout, or if the HTTP
status code is higher or equal to 400, however no retries are done for 401/403/511
errors which are authentication errors.
Example for the following configuration: Intial backoff: 300 ms, Backoff factor: 2, and Maximum number of retries: 4 The HTTPClient component does a first GET operation on the server (first call). A connection timeout error is returned, the retry mechanism is activated, and the component waits for 300 milliseconds. A second attempt is then made (first retry). A 503 HTTP response is returned, the wait duration is multiplied by 2, so the component waits for 600 milliseconds. A third attempt is made (second retry). A 500 Internal server error is returned, the wait duration is multiplied by 2, so the component waits for 1200 milliseconds. A fourth attempt is made (third retry), and this time it is successful. No additional attempt is made, and the response is returned. |
Accept redirections | Select this option to apply the HTTP Redirection rules on your resources.
|
Pagination | Select this option to enable the pagination strategy. For more information
about pagination strategy, see Pagination section of JIRA Server platform REST API
reference. Note that pagination is only compliant with JSON payload and the desired elements must be in an array in the JSON payload. You need to set the following options for pagination to work properly.
Information noteNote: The Pagination option is available only when you
have installed the 8.0.1-R2023-05 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.
|
Normalize the JSON HTTP response | Select this option to normalize inconsistencies in the JSON payload in order
for the component to correctly parse these documents:
This option is available when JSON is selected in the Response body format option in the Basic settings of the component. |
Add attachments | Select this option to add files as attachments to a multipart request. The
Files to upload table appears when you select this
option, allowing you to set the following parameters:
The Add attachments option is available when you select the Request body option and select Form data from the Body type drop-down list in the Basic settings view. Information noteNote: This
option is available only when you have installed the 8.0.1-R2023-05 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.
|
Force JSON numbers to "Double" type in response body | Select this option if you want to force all JSON numbers to be converted to
Double type. Differentiating between Integer and Double numbers is not always
possible in JSON. For instance, a geographic location matrix, that should contain only Double, may have one of its item inferred as Integer "[47, -1.567075]". It is error prone, since the connector will try to generate an Integer array, and then will try to add a Double inside. Forcing all numbers to Double will prevent these errors. This option is available when JSON is selected from the Response body format drop-down list in the Basic settings view. |
Die on error | Select this option to stop the execution of the Job if the status code of the response is different from 2xx. |
Global Variables
Global Variables |
ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box. NB_LINE: the number of rows read by an input component or transferred to an output component. This is an After variable and it returns an integer. |
Usage
Usage rule | This component can be used as intermediate step in a data flow or as an end object in the Job flowchart. |
Limitations | This component cannot be placed immediately after the tRESTRequest component. As a workaround, place a tMap component between the two components to copy the input data to the output. |