# REST client step

The REST client transformation step enables you to consume RESTful services.

Representational State Transfer (REST) is a key design idiom that embraces a stateless client-server architecture in which web services are viewed as resources and can be identified by their URLs.

{% hint style="info" %}
You can escape input field data by using the Calculator step and the **Mask XML content from string A** or **Escape HTML content** function.
{% endhint %}

### General tab

* **Step name**: Specify the unique name of the REST client step on the canvas. You can customize the name or leave it as the default.

Use the **General** tab to enter connection information for your REST resource.

| Option                                      | Description                                                                                                                            |
| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **URL**                                     | Specify the path to the REST resource. To set the URL from a field in the incoming stream, select **Accept URL from field**.           |
| **Accept URL from field**                   | Select to use a field in the incoming stream as the URL. If you select this option, **URL field name** becomes available.              |
| **URL field name**                          | Select the incoming field that contains the URL. Available only if you select **Accept URL from field**.                               |
| **HTTP method**                             | Select how this step interacts with the resource: **GET**, **POST**, **PUT**, **DELETE**, **HEAD**, **OPTIONS**, or **PATCH**.         |
| **Get method from field**                   | Select to set the HTTP method from a field in the incoming stream. If you select this option, **Method field name** becomes available. |
| **Method field name**                       | Select the incoming field that contains the HTTP method. Available only if you select **Get method from field**.                       |
| **Body field**                              | Select the incoming field that contains the request body for **POST**, **PUT**, and **PATCH** methods.                                 |
| **Application type**                        | Select the application type of the resource content.                                                                                   |
| **Result field name**                       | Specify the name of the output field that contains the response body.                                                                  |
| **HTTP status code field name**             | Specify the name of the output field that contains the HTTP status code.                                                               |
| **Response time (milliseconds) field name** | Specify the name of the output field that contains the response time in milliseconds.                                                  |
| **Response header field name**              | Specify the name of the output field that contains the response headers.                                                               |

{% hint style="warning" %}
If you have a transformation created before Pentaho 8.3, note that the **DELETE** method can no longer carry a payload from **Body field**. To pass data, either use a **PUT** request first, or include the data in the URL.
{% endhint %}

### Authentication tab

If the resource requires authentication, use the **Authentication** tab.

| Option            | Description                                                                    |
| ----------------- | ------------------------------------------------------------------------------ |
| **HTTP login**    | Username required to access the resource.                                      |
| **HTTP password** | Password associated with **HTTP login**.                                       |
| **Preemptive**    | Select to send credentials before the server returns an unauthorized response. |
| **Proxy host**    | Proxy host name (if proxy authentication is required).                         |
| **Proxy port**    | Proxy port (if proxy authentication is required).                              |

### SSL tab

Use the **SSL** tab for resources that require SSL certificate authentication.

| Option                     | Description                                                                                                   |
| -------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **Trust store file**       | Location of the trust store file.                                                                             |
| **Trust store password**   | Password for the trust store used by the client.                                                              |
| **Trust all certificates** | Select to trust all certificates, including self-signed certificates, when using HTTPS. Use only for testing. |

### Headers tab

Use the **Headers** tab to define HTTP header values stored in incoming fields.

| Column    | Description                                    |
| --------- | ---------------------------------------------- |
| **Field** | Incoming field that contains the header value. |
| **Name**  | Header name.                                   |

Select **Get fields** to populate the table with fields from the incoming stream.

### Parameters tab

Use the **Parameters** tab to define parameter values for **POST**, **PUT**, **DELETE**, and **PATCH** requests. (Parameters for **GET** requests should be included in the URL.)

| Column    | Description                                       |
| --------- | ------------------------------------------------- |
| **Field** | Incoming field that contains the parameter value. |
| **Name**  | Parameter name.                                   |

Select **Get** to populate the table with fields from the incoming stream.

{% hint style="info" %}
The Parameters table is available only when **HTTP method** is set to **POST**, **PUT**, **DELETE**, or **PATCH**.
{% endhint %}

### Matrix parameters tab

Use the **Matrix Parameters** tab to define matrix parameter values for **POST**, **PUT**, **DELETE**, and **PATCH** requests.

| Column    | Description                                              |
| --------- | -------------------------------------------------------- |
| **Field** | Incoming field that contains the matrix parameter value. |
| **Name**  | Matrix parameter name.                                   |

Select **Get** to populate the table with fields from the incoming stream.

{% hint style="info" %}
The Matrix Parameters table is available only when **HTTP method** is set to **POST**, **PUT**, **DELETE**, or **PATCH**.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/rest-client-step.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
