# HTTP-request step

![](/files/-MZbIHq0dUUVtZC5W2wR)

**HTTP-request step** allows you to interact with HTTP & REST APIs

![](/files/-MZbKD-qJyk0q-eq7QKc)

### **1. Set request method, paste URL and add parameters**

![](/files/-MZbK_kHCcOtifa9XRc7)

You can add parameters both in URL input, like `https://api.directual.com?param1=aaaa&param2={{field}}` or using Parameters tab. Feel free to add `{{fields}}` using [template system](/template-system/basics-of-template-system.md).

{% hint style="info" %}
Remember that if parameter value contains characters like " ", "`+`", "`–`", wrap it in `{{#encodeURIComponent}}` *parameter value* `{{/encodeURIComponent}}`
{% endhint %}

### 2. **Optional: Add headers and Body**

You can add headers and body  for your request, using [template system](/template-system/basics-of-template-system.md).

Note that choosing the body type (json, x-www-form-urlencoded) you add specific headers.

{% hint style="info" %}
If your JSON-body includes strings with special characters (like `"`), wrap it with `{{#escape}}wrapped "text"{{/escape}}`
{% endhint %}

### **3. Optional: Setup auth**

Choose the proper auth (or no one) and the authorisation header will be automatically generated when you send the request.

### 4. Optional: Add custom options

* **Save API response** to the field. Field should be type of json or string. It's easy to parse the response using [JSON-step](/scenarios/editing-scenarios/action-steps/json-step.md).
* **Ignore HTTP-errors**. If this option is turned off, scenario will stop executing and call [Catch error step](/scenarios/editing-scenarios/system-steps/catch-error-step.md), if any. If it is on, the scenario will continue executing.
* **Enable retry**. Retry the request in case of error-code.
* **Retry non idempotent requests** (e.g. POST). have a look at a nice explanation [what is non idempotent requests](https://www.restapitutorial.com/lessons/idempotency.html).
* **Retry count**. How many times retry connecting.
* **Read timeout**, ms. Max 180000 — 180 sec.
* **Connect timeout**, ms. Max 5000 — 5 sec.
* **Certificates**. Add (if needed) .PEM text and key
* **Proxy**. Add (if needed) proxy. You may [have one here](https://proxy-seller.com/?partner=HDL8XUZ8FQTSNU) (choose IPv4).

### 5. Sending files

Set the content type to `multipart/form-data`

![](/files/OR2GJ7oxu4AtoTssO2yf)

Body for that type of request should be the following:

![](/files/AjgNjJ8nZ7bJwKorMm2w)

```javascript
{
	"file": "{{ContextVar.fileUrl}}", // URL of your file
	"__files_fields__":["file"]
}
```


---

# 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://readme.directual.com/scenarios/editing-scenarios/integration-steps/http-request-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.
