# Request Module

\
&#x20;Import

```
import request from 'request';
```

Represents the current HTTP request. The request includes the following properties:

* `_id` (ObjectId) the request identifier
* `body` (Object) the request body
* `client` (Object)
  * `_id` (ObjectId) the app client identifier
  * `key` (String) the app client key used to perform the request
* `headers` (Object) an object keyed by the request headers.
* `host` (String) the hostname
* `params` (Object) the parsed params from an api endpoint. (eg /routes/:foo -> req.params.foo)
* `path` (String) the url path
* `query` (Object) the parse http query portion of the request (eg /foo?bar=baz -> req.query.bar=='baz')
* `url` (String) the original request url

### Methods

[getCookie(cookie)](https://docs.medable.com/reference#section-getcookie-cookie-)\
[getHeader(header)](https://docs.medable.com/reference#section-getheader-header-)

### getCookie(cookie)

Get a cookie value.

**Arguments**

* `cookie` (String) the cookie name.

**Returns**

* `value` (String) the cookie value.

### getHeader(header)

Gets a request header

**Arguments**

* `header` (String) the name of the header.

**Returns**

* `value` (String) the header value.


---

# 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.medable.com/cortex-api/scripting/modules-1/request-module.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.
