Repository navigation
rules specification
Audrey Verlynde edited this page Apr 6, 2020
·
1 revision
Rules must be sent as a list of rule object.
| Attribute | Type | Required | Description |
|---|---|---|---|
| type | string | yes | The rule type. Possible values: inout, outin. |
| request | object | yes | The Request object. |
| response | object | only with type=inout
|
The Response object. |
| timeout | long | no | Time in milliseconds to wait before the first request. |
| repeat | integer | no | Number of request to send (0 for infinite). |
| interval | long | no | Time in milliseconds between each request. |
| Attribute | Type | Required | Description |
|---|---|---|---|
| method | string | yes | The HTTP method/verb. |
| path | string | yes | The path to resource or host URL. |
| headers | object | no | An object representing the headers. |
| body | string | no | The body of the request. |
| Attribute | Type | Required | Description |
|---|---|---|---|
| status | integer | yes | The HTTP Response status (between 100 and 600). |
| headers | object | no | An object representing the headers. |
| body | string | no | The body of the request. |
[
{
"type": "inOut",
"request": {
"method": "GET",
"path": "/hello"
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json"
},
"body": "Hello !"
}
},
{
"type": "outIn",
"request": {
"method": "POST",
"path": "http://www.domain.com/light1",
"headers": {
"Content-Type": "application/json"
},
"body": "{\"action\": \"on\"}"
},
"timeout": 5000,
"repeat": 1
}
]- type: inOut
request:
method: GET
path: /hello
response:
status: 200
headers:
Content-Type: application/json
body: "Hello !"
- type: outIn
request:
method: POST
path: http://www.domain.com/light1
headers:
Content-Type: application/json
body: "{\"action\": \"on\"}"
timeout: 5000
repeat: 1