Request configuration
List of parameters that can be used
Parameter | Type | Description | Example |
---|---|---|---|
args | list | Custom 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 integer | args: - id: 1 |
method | get / post / put / patch / delete / options / head | HTTP method | get |
endpoint | string | URL of your endpoint | http://localhost:8000/blog/1 |
headers | list | List of headers in format - Header-Name: value | - Content-Type: application/json |
body | string | Simple string containing body data | { id: 123 } |
allow-headers | list | List of headers you want to show, will remove any other header and keep the output clean | - Content-Type |
Examples
Simple get
method: GETendpoint: https://jsonplaceholder.typicode.com/todos/5headers: - Content-Type: application/json - Accept: application/json
Get with args
args: - id: 1 # specify 1 as default valuemethod: GETendpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value hereheaders: - Content-Type: application/json - Accept: application/json
Args can be used on the run command.
sendex run get-example.yml id=5
Get hiding all headers from output
args: - id: 1 # specify 1 as default valuemethod: GETendpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value hereheaders: - Content-Type: application/json - Accept: application/jsonallow-headers: - Nil
Get with only listed headers being shown
args: - id: 1 # specify 1 as default valuemethod: GETendpoint: https://jsonplaceholder.typicode.com/todos/{id} # use ID value hereheaders: - Content-Type: application/json - Accept: application/jsonallow-headers: - Content-Type
Simple post
method: POSTendpoint: https://jsonplaceholder.typicode.com/todosbody: | { "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 valuemethod: POSTendpoint: https://jsonplaceholder.typicode.com/todosbody: | { "userId": {id}, "title": "delectus aut autem", "completed": false }headers: - Content-Type: application/json - Accept: application/json
Args can be used on the run command.
sendex run post-example.yml id=5