# Sending requests

{% hint style="info" %}
This documentation is for ARC version 16 and up.
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=7_16GOBseXQ>" %}
Introduction video
{% endembed %}

## The requests workspace

The requests workspace is the main part of the application. It allows you to open multiple requests in a single view. The workspace hosts tabs for the HTTP or web socket editors. To choose between them long-press the add button in the tabs line.

![Requests workspace in Advanced REST Client](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgan9KzZE4YMcXxQfL%2Frequests%20workspace.png?alt=media\&token=33fc69cd-865e-4179-a735-c1e833d34da7)

### Request editor

In the request editor, you build the HTTP request to make an API call. You have to provide at least the operation (HTTP method) and the URL of the API resource. The editor also allows you to define HTTP headers and the message body (when applicable to the selected operation). Here you can also define authorization strategy by configuring one of the supported authorization schemes, request actions, and request execution configuration. Finally, you can also generate code snippets for the current request.

### The request URL editor

The HTTP request URL is an API endpoint URL you want to perform an operation on. The input field allows you to provide any valid URL data, like, `https://api.domain.com/endpoint?param=value`

![URL editor in Advanced REST Client](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgckLSf76ey07-8ZeC%2Furl-editor.png?alt=media\&token=ac5bcf9e-210e-46f7-9d03-f33f3bfe6982)

{% hint style="info" %}
The URL is passed to the HTTP client unprocessed to give you more control over request parameters. This means that special characters must be encoded before sending the request.
{% endhint %}

You can edit query parameters directly in the URL field, but the URL editor has a convenient parameters editor to provide the values and to encode or decode the URL.

![Query parameters editor in Advanced REST Client](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgd64XAilLwVt84Ojx%2Fquery-parameters.png?alt=media\&token=76db25a2-70d1-421c-8484-1d5379cf0ebe)

You can disable query parameters. They won't be included in the request, but they can be enabled later when needed.

When you see an error indicator in the query parameter this means that the value is invalid per URI scheme specification. Use the **Encode URL** button to fix the problem.&#x20;

![Query parameters with error indicator](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgeF2Fy6hu8qtLjBkv%2Ferror-query-parameters.png?alt=media\&token=1ee592d5-7c69-4116-8c6b-102d8ed5fc91)

{% hint style="info" %}
Once encoded value will be encoded again producing an invalid entry. When you want to encode values again, decode the values first and then encode them.
{% endhint %}

### API operation (HTTP method)

Typical REST operations are:

* POST - create a resource&#x20;
* GET - read a resource or a collection of resources
* PUT - update a resource by providing a new value to replace the old one
* PATH - update a resource with only a part of the resource
* DELETE - deletes a resource

There are less commonly used methods and Advanced REST Client supports them all but for the purpose of this tutorial we ignore them as probably, you won't use them.

![Operation selector](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTggtCVIZkpccVybrGi%2Foperations.png?alt=media\&token=d82030f7-9751-4564-b350-9416882c8a09)

### HTTP headers

The headers are additional meta-information sent to the server to inform it how to process the message. There are well-defined request and response headers like `content-type` or `accept`. Your API, however, may require custom headers. The headers editor allows you to define these headers.

{% hint style="info" %}
ARC does not generate any request headers with exception of the`Host` header which is required to make a request. Unlike other HTTP clients, only headers that are defined in the editor are sent to the server. This behavior can be configured in the settings.
{% endhint %}

By default, you see the headers form. Add a header by clicking on the **Add** button. Start typing a header name. The editor renders suggestions if the header name is one of the defined in the specification headers.

![HTTP headers editor](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTghN0PAas4Vdulv4IA%2Fheaders-editor.png?alt=media\&token=b3e74b25-5d35-49f5-8a24-86211803f4b7)

Similar to query parameters, headers can be temporarily disabled to test various options. When the toggle button is unselected then the header value is kept in the editor but it is excluded from the request.

You can switch to the text editor to enter the values manually.

![HTTP headers text editor](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgiP8ov4v9l0pVP8_1%2Fheaders-text-editor.png?alt=media\&token=1d4d9ffc-36fd-43b1-baeb-e43493c5acd8)

### Request body

The body is the message you want to send to the server. In RESTful APIs, this is the resource you create or update.

![HTTP body raw editor](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgiz9esHgXG7kptuCq%2Fbody-raw-editor.png?alt=media\&token=3d39b840-5e55-4401-85e5-31a24ee82685)

{% hint style="info" %}
GET and HEAD methods cannot define a body on a request. Even though it is technically possible, clients probably won't work with such a request.&#x20;
{% endhint %}

{% hint style="info" %}
You don't need to set the Content-Length header. It is added automatically when preparing the message. When this header is defined in the headers list it will be used instead. This way you can test your server for invalid input.
{% endhint %}

The body editor supports syntax highlighting for several content types like JSON and XML. You can switch between different types of body editors. See a related article about editing the body.

### Authorization

The authorization editor supports several authorization strategies like basic scheme, OAuth 2, client certificates, and so forth. The authorization configuration is described in the related document. You can use more than a single authorization strategy at the same time. &#x20;

![Authorization scheme editor](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgk8-TT3ChKZbNzhw8%2Fauth-selector.png?alt=media\&token=c4280c30-9c97-4b39-aab7-14de001e4db7)

When selecting a strategy don't forget to enable it in the selector or otherwise it won't be used with the request.

### Request actions

Request actions are the ARC's way to perform some tasks when the request is executed. Actions are executed before and after the request updating your environment. Actions can be conditionally executed, meaning the action runs when a specified condition on the HTTP request data is met. For example, you can check whether a response has the desired status and set a variable from the response body.  You can learn more about request actions in the dedicated section.

![Request actions in Advanced REST Client](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTglc_btm7FOW9f_OGt%2Fresponse-actions.png?alt=media\&token=ba8739c2-e598-4f97-9262-015c60f227dd)

### Per request configuration

In the request editor, you can set per request configuration options that override the global settings for the HTTP  request processing.

![HTTP request execution configuration](https://2300023309-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LgJa7u7Cw8HjSR0oUlx%2F-MTgYYOt9tjhaa7x7fKO%2F-MTgmQjvizhPhXLVHltQ%2Frequest-configuration.png?alt=media\&token=9f851db4-07b0-49d9-8582-8e385e8968ec)


---

# 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.advancedrestclient.com/using-arc/sending-requests.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.
