# requests Action

Sends concurrent requests. Can be configured either by an inline JSON template or by referencing a JSON template in the `src` attribute.

The result of executing the template, whether given inline or referenced, must be a JSON object with the a property for each request ID with a JSON object like defined for the [`request` action](https://sevenval.gitbook.io/flat/reference/actions/request) as its value.

Example: `requests` with inline JSON

```markup
<requests>
{
  "main":{
     "url":"http://example.com",
     "method":"GET",
     …
   },
  "foo":{
     "url":"http://example.com",
     "method":"POST",
     …
  },
  "bar":{
     …
  }
}
</requests>
```

**Note:** An `id` property in the JSON request configuration will be ignored:

```javascript
{
  "myID":{
     "id":"ignored",
     "url":"http://example.com",
     "method":"GET",
     …
   },
   …
}
```

Example: `requests` with referenced resource

```markup
<requests src="requests.json"/>
```

with requests.json:

```javascript
{
  "main":{
     "url":"http://example.com",
     "method":"GET",
     …
   },
  "foo":{
     "url":"http://example.com",
     "method":"POST",
     …
  },
  "bar":{
     …
  }
}
```

Example: `requests` with variable

```markup
<template out="$requests">
{
  "main":{
     "url":"http://example.com",
     "method":"GET",
     …
   },
  "foo":{
     "url":"http://example.com",
     "method":"POST",
     …
  },
  "bar":{
     …
  }
}
</template>
<requests src="$requests"/>
```

## See also

* [`request` action](https://sevenval.gitbook.io/flat/reference/actions/request) (reference)
