This step definition is used to set the request body for API calls like POST or PUT. It allows you to send JSON data with your request, such as user details or post content.
Given (?:I set the request body to|the request body is) '([^']*)'$
This tells the test to prepare the request with the provided JSON as the body.
Example #1: Given I set the request body to '{"name": "John", "email": "john@example.com"}'
Example #2: Given the request body is '{"title": "Test Post", "body": "This is a test"}'