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