This step definition is used to send an HTTP request with body data provided in a table. It’s a shortcut that lets you set request values (like name, email, age) directly in the step itself without needing a separate step to define the body first.
When (?:I )?send a ([A-Z]+) request to "([^"]+)" with values:$
Sends a request (POST, PUT, etc.) to the given endpoint, using the values listed in the table as the JSON request body.
Example:
When I send a POST request to "/users" with values:
| name | John Doe |
| email | john@example.com |
| age | 30 |