tHTTPClient: configuration and output
The output of the tHTTPClient component varies with the settings of the
Response body format option, the Extract a sub-part of
the response option, the Returned content option, and
the Output key/value pairs option. This article lists the output
cases of the tHTTPClient component under different configuration combinations by retrieving
the same content using the following Job.
The following figure shows the base configuration of the tHTTPClient component.
The query response payload is given below.
[
{
"name": "Peter",
"age": 40,
"male": true,
"addresses": {
"city": "Nantes",
"zip": "44000",
"street": "bd prairie au duc"
},
"cars": [
{"brand": "Ford", "model": "Transit", "km": 123456},
{"brand": "Renault", "model": "Clio", "km": 87234}
]
}
]
- Treating the response as a text string
- tHTTPClient configuration
Configuration item
Setting
Schema columns -
body, type String.Information noteNote: The Guess schema button works. That is, you can have the schema generated automatically by clicking the Guess schema button.
Response Body format TEXT Returned content Body Output key/value pairs Disabled -
body, type String.
- Output
- tHTTPClient configuration
- Treating the response as a text string and returning status, headers, and body of the response
- tHTTPClient configuration
Configuration item
Setting
Schema columns - body, type String.
- headers, type String.
- status, type Int.
Information noteNote: The Guess schema button works. That is, you can have the schema generated automatically by clicking the Guess schema button.Response Body format TEXT Returned content Status, headers, body Output key/value pairs Disabled - Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning the entire response
- tHTTPClient configuration
Configuration item
Setting
Schema columns - name, type String.
- age, type Int.
- male, type Boolean.
- address, type String (will be a string representation of a JSON object).
- cars, type String (will be a string representation of a JSON object).
Information noteWarning: The Guess schema does not work in this case. You need to create the schema manually.Response Body format JSON Extract a sub-part of the response Empty, . (a dot), or .root Returned content Body Output key/value pairs Disabled - Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning status, headers, and body of the entire response
- tHTTPClient configuration
Configuration item
Setting
Schema columns - body, type String (will be a string representation of a JSON object).
- headers, type String (will be a string representation of a JSON object).
- status, type Int.
Information noteNote: The Guess schema button works. That is, you can have the schema generated automatically by clicking the Guess schema button.Response Body format JSON Extract a sub-part of the response Empty, . (a dot), or .root Returned content Status, headers, body Output key/value pairs Disabled - Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning the address information about the first
sub-element under the root element
- tHTTPClient configuration
Configuration item
Setting
Schema columns - city, type String.
- zip, type String.
- street, type String.
Information noteWarning: The Guess schema does not work in this case. You need to create the schema manually.Response Body format JSON Extract a sub-part of the response .root[0].addresses Returned content Body Output key/value pairs Disabled - Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning the information about the cars of the
first sub-element under the root element
- tHTTPClient configuration
Configuration item
Setting
Schema columns - brand, type String.
- model, type String.
- km, type Int.
Information noteWarning: The Guess schema does not work in this case. You need to create the schema manually.Response Body format JSON Extract a sub-part of the response .root[0].cars Returned content Body Output key/value pairs Disabled - Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning the information about the sub-elements
under the root element using key/value pairs
- tHTTPClient configuration
Configuration item
Setting
Schema columns - name, type String.
- full_address, type String.
- first_car_brand, type String.
Information noteNote: The Guess schema button works. That is, you can have the schema generated automatically by clicking the Guess schema button.Response Body format JSON Extract a sub-part of the response empty, . (a dot), or .root Returned content Body Output key/value pairs Enabled. Forward input values Disabled Key/value pairs - "name": "{.response.name}"
- "full_address": "{.response.addresses.street}, {.response.addresses.zip}, {.response.addresses.city}"
- "first_car_brand": "{.response.cars[0].brand}"
- Output
- tHTTPClient configuration
- Treating the response as a JSON string and returning a value of the first sub-element under
the root element
- tHTTPClient configuration
Configuration item
Setting
Schema columns - field, type String.
Information noteWarning: The Guess schema does not work in this case. You need to create the schema manually.Response Body format JSON Extract a sub-part of the response .root[0].name Returned content Body Output key/value pairs Disabled. - Output
- tHTTPClient configuration