Request configuration
List of parameters that can be used
Section titled “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
Section titled “Examples”Simple get
Section titled “Simple get”method: GETendpoint: https://jsonplaceholder.typicode.com/todos/5headers: - Content-Type: application/json - Accept: application/jsonGet with args
Section titled “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/jsonArgs can be used on the run command.
sendex run get-example.yml id=5Get hiding all headers from output
Section titled “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: - NilGet with only listed headers being shown
Section titled “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-TypeSimple post
Section titled “Simple post”method: POSTendpoint: https://jsonplaceholder.typicode.com/todosbody: | { "userId": 222, "title": "delectus aut autem", "completed": false }headers: - Content-Type: application/json - Accept: application/jsonPost with args
Section titled “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/jsonArgs can be used on the run command.
sendex run post-example.yml id=5