Post Data to API Request Command: REQ_POST_DATA
The Post Data to API Request command is used to send data in the body of an API request. This is commonly used in automation to create or update resources on a server by passing structured data such as JSON or XML in the request body.
Example: Suppose you want to create a new user by sending a POST request to an API endpoint.
Steps to Configure:
- Select Post Data to API Request from the Action dropdown.
- Leave the Screen Name field blank.
- Leave the Element Key field blank as this command does not return any output.
- In the Parameters section, enter the data to be posted to the API. This should be in a valid format, such as JSON or XML, for example:
{
“name”: “John Doe”,
“email”: “johndoe@example.com”,
“role”: “admin”
}
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Expected Outcome on execution:
- The automation sends the provided JSON data to the API endpoint.
Notes:
- Ensure the API expects the data format you are providing (e.g., JSON, XML).
- This command is only used to send data in the request body and does not return any output.
- If authentication is required, ensure the necessary headers (e.g., Authorization) are set before making the request.
Example Workflow:
The following screenshot illustrates how the Post Data To Api Request command is structured within an API test case in HuLoop. It shows the sequence of API steps, including defining request type, headers, resource, and data.

When configuring this command, ensure that:
- It is placed after defining the request type (Define Api Request Type command) and resource URL (Define Api Request Resource command).
- The necessary headers are set using the Define Api Request Header command to specify the content type (e.g., application/json).