For testing some POST/PUT-endpoints, it is necessary to use unique values in the request body. For example:
POST-request {"user_email": "test@test.com", "user_password": "123456qwerty"} to http://server.com/api/user for creating the user.
Now we cannot apply hey for this case, because user_email in each request must be unique.
Adding templates can help us execute requests. During handling of request, the markers in the template will be replaced with random values that differ for different markers.
For our example, we need to use the following template:
{"user_email": "{{.Email}}", "user_password": "{{.String}}"}
A random email address will be generated on the Email marker, e.g. gyf4ws3e2f@og9vu.com.
In request may be multiple markers, e.g. {"primary_email": "{{.Email_1}}", "secondary_email": "{{.Email_2}}"}
In other cases, you may need random integers, strings, float, date/time/datetime.
In header necessary to generate the RequestID.
For testing some POST/PUT-endpoints, it is necessary to use unique values in the request body. For example: POST-request {"user_email": "test@test.com", "user_password": "123456qwerty"} to http://server.com/api/user for creating the user. Now we cannot apply hey for this case, because user_email in each request must be unique. Adding templates can help us execute requests. During handling of request, the markers in the template will be replaced with random values that differ for different markers. For our example, we need to use the following template: {"user_email": "{{.Email}}", "user_password": "{{.String}}"} A random email address will be generated on the Email marker, e.g. gyf4ws3e2f@og9vu.com. In request may be multiple markers, e.g. {"primary_email": "{{.Email_1}}", "secondary_email": "{{.Email_2}}"}
In other cases, you may need random integers, strings, float, date/time/datetime. In header necessary to generate the RequestID.