# RestRequestMessage

RestRequestMessage object represents an HTTP request returned by the REST Store message script.

### Constructor <a href="#h.oo8fqfidvw4z" id="h.oo8fqfidvw4z"></a>

```javascript
var message = new RestRequestMessage();
```

### Fields <a href="#h.2av81iyk042f" id="h.2av81iyk042f"></a>

| **Name** | **Description**                                                                                                                              |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| body     | Contains the body of the HTTP request.                                                                                                       |
| headers  | Contains the HTTP request headers. Methods and properties are equivalent to the [Bundle](https://docs.monokot.io/scripts/api/bundle) object. |

### Examples <a href="#h.6y2dhlx9go9i" id="h.6y2dhlx9go9i"></a>

A custom HTTP header can be added using the following code:

```javascript
var request = new RestRequestMessage();

// Add header
request.headers.set('User-Agent', 'My Agent ' + new Date().getTime());
```

Note that HTTP message headers generated by the script have higher priority than the static HTTP headers specified in the REST Store.


---

# 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.monokot.io/time-series-and-stores/rest-connectivity/restrequestmessage.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.
