Sending json in body example
Could I have an example of how to send json as a body payload please?
This. Also how can you read a json body from a file?
The similar way how you could do in Ansible
One way is:
- name: send request as list
request:
...
body: '{{ item }}'
...
with_items:
- '{"a":"b","c":{ "d":"e","f":"g"}}
- '{"x":"y"}'
-....
OR with "with_items_from_csv" as in the documentation, you can find the example file in "example/fixtures/transactions.csv". Actually the important thing here is that you need to name the dataset somehow. and add the lines. In the example it is "txn" and that's why this is the way how we can use it: body: '{{ item.txn }}' that say "please itearet through the items in txn dataset" (something like that :D).
The benchmark.yaml file contains all the examples.