Skip to content

Request configuration

List of parameters that can be used

ParameterTypeDescriptionExample
argslistCustom arguments which are used to give more control in request. Can be added to the endpoint, headers or body parameters using a {} syntax. The args can then be defaulted to a string or integerargs: - id: 1
methodget / post / put / patch / delete / options / headHTTP methodget
endpointstringURL of your endpointhttp://localhost:8000/blog/1
headerslistList of headers in format - Header-Name: value- Content-Type: application/json
bodystringSimple string containing body data{ id: 123 }
allow-headerslistList of headers you want to show, will remove any other header and keep the output clean- Content-Type

Examples

Simple get

method: GET
endpoint: https://jsonplaceholder.typicode.com/todos/5
headers:
- Content-Type: application/json
- Accept: application/json

Get with args

args:
- id: 1 # specify 1 as default value
method: GET
endpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value here
headers:
- Content-Type: application/json
- Accept: application/json

Args can be used on the run command.

Terminal window
sendex run get-example.yml id=5

Get hiding all headers from output

args:
- id: 1 # specify 1 as default value
method: GET
endpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value here
headers:
- Content-Type: application/json
- Accept: application/json
allow-headers:
- Nil

Get with only listed headers being shown

args:
- id: 1 # specify 1 as default value
method: GET
endpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value here
headers:
- Content-Type: application/json
- Accept: application/json
allow-headers:
- Content-Type

Simple post

method: POST
endpoint: https://jsonplaceholder.typicode.com/todos
body: |
{
"userId": 222,
"title": "delectus aut autem",
"completed": false
}
headers:
- Content-Type: application/json
- Accept: application/json

Post with args

args:
- id: 1 # specify 1 as default value
method: POST
endpoint: https://jsonplaceholder.typicode.com/todos
body: |
{
"userId": {id},
"title": "delectus aut autem",
"completed": false
}
headers:
- Content-Type: application/json
- Accept: application/json

Args can be used on the run command.

Terminal window
sendex run post-example.yml id=5