# 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.

Information noteNote: Behavior change: From Talend Studio v8.0.1-R2024-12 onwards, JSON arrays are parsed as arrays. In earlier versions, JSON arrays were returned as a single string with elements separated by line breaks (\n). If you have existing Jobs that rely on the previous behavior for single-element JSON arrays, you can restore the legacy output by setting the following system property to true:

```
org.talend.components.common.dssldictionary.DSSLDictionary.SINGLE_ELEMENT_NOT_ARRAY
```

This property is intended for backward compatibility; prefer updating Jobs to handle arrays where possible.

![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-1.png)

The following figure shows the base configuration of the tHTTPClient component. ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-h.png)

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 | <ul> <li><span>body</span>, type String.<div><span>Information note</span><span>Note:</span> The                                          <span>Guess schema</span> button works. That is,                                       you can have the schema generated automatically by clicking                                       the <span>Guess schema</span> button.</div></li> </ul> |
    | Response Body format | TEXT |
    | Returned content | Body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-2.png)
* Treating the response as a text string and returning status, headers, and body of the response
  * tHTTPClient configuration
    | Configuration item | Setting |
    | --- | --- |
    | Schema columns | <ul> <li><span>body</span>, type String.</li> <li><span>headers</span>, type String.</li> <li><span>status</span>, type Int.</li> </ul><br><br>Information noteNote: The Guess schema button works. That is,<br>you can have the schema generated automatically by clicking the<br>Guess schema button. |
    | Response Body format | TEXT |
    | Returned content | Status, headers, body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-3.png)
* Treating the response as a JSON string and returning the entire response
  * tHTTPClient configuration
    | Configuration item | Setting |
    | --- | --- |
    | Schema columns | <ul> <li><span>name</span>, type String.</li> <li><span>age</span>, type Int.</li> <li><span>male</span>, type Boolean.</li> <li><span>address</span>, type String (will be a string                                    representation of a JSON object).</li> <li><span>cars</span>, type String (will be a string                                    representation of a JSON object).</li> </ul><br><br>Information noteWarning: The Guess schema does not<br>work in this case. You need to create the schema manually. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | Empty, . (a dot), or<br>.root |
    | Returned content | Body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-4.png)
* Treating the response as a JSON string and returning status, headers, and body of the entire response
  * tHTTPClient configuration
    | Configuration item | Setting |
    | --- | --- |
    | Schema columns | <ul> <li><span>body</span>, type String (will be a string                                    representation of a JSON object).</li> <li><span>headers</span>, type String (will be a string                                    representation of a JSON object).</li> <li><span>status</span>, type Int.</li> </ul><br><br>Information noteNote: The Guess schema button works. That is,<br>you can have the schema generated automatically by clicking the<br>Guess schema button. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | Empty, . (a dot), or<br>.root |
    | Returned content | Status, headers, body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-5.png)
* 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 | <ul> <li><span>city</span>, type String.</li> <li><span>zip</span>, type String.</li> <li><span>street</span>, type String.</li> </ul><br><br>Information noteWarning: The Guess schema does not<br>work in this case. You need to create the schema manually. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | .root[0].addresses |
    | Returned content | Body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-6.png)
* 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 | <ul> <li><span>brand</span>, type String.</li> <li><span>model</span>, type String.</li> <li><span>km</span>, type Int.</li> </ul><br><br>Information noteWarning: The Guess schema does not<br>work in this case. You need to create the schema manually. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | .root[0].cars |
    | Returned content | Body |
    | Output key/value pairs | Disabled |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-7.png)
* 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 | <ul> <li><span>name</span>, type String.</li> <li><span>full_address</span>, type String.</li> <li><span>first_car_brand</span>, type String.</li> </ul><br><br>Information noteNote: The Guess schema button works. That is,<br>you can have the schema generated automatically by clicking the<br>Guess schema button. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | empty, . (a dot), or<br>.root |
    | Returned content | Body |
    | Output key/value pairs | Enabled. |
    | Forward input values | Disabled |
    | Key/value pairs | <ul> <li><kbd>"name"</kbd>:                                       <kbd>"{.response.name}"</kbd></li> <li><kbd>"full_address"</kbd>:                                       <kbd>"{.response.addresses.street},                                       {.response.addresses.zip},                                       {.response.addresses.city}"</kbd></li> <li><kbd>"first_car_brand"</kbd>:                                       <kbd>"{.response.cars[0].brand}"</kbd></li> </ul> |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-8.png)
* 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 | <ul> <li><span>field</span>, type String.</li> </ul><br><br>Information noteWarning: The Guess schema does not<br>work in this case. You need to create the schema manually. |
    | Response Body format | JSON |
    | Extract a sub-part of the<br>response | .root[0].name |
    | Returned content | Body |
    | Output key/value pairs | Disabled. |
  * Output ![](https://help.qlik.com/talend/en-US/components/8.0/Resources/images/thttpclient-schema-and-output-9.png)