Create Requests :
To create a new Rest request for a Hostbox:
- Select the
Resttype Hostbox and click "New Request" to create a named request. - After request creation, click on the Hostbox to see the created request.
- Click on the request to select it and view the dynamically created URL in the URL Input Box.
- Choose the appropriate HTTP method.
- Provide necessary data (parameters, body, headers, rules) if required.
- Save the request.
- After saving the request, click the
Startbutton to start the Hostbox.
Example :
We will simulate an E-Commerce request which has the following request & response body:
// Request Body
{
"productId": "1000",
"productName": "iphone 15",
"company": "Apple",
"price": "85000"
}
// Response Body
{
"cartId": "CR230",
"message": "Added Successfully"
}Execute Rest Request
To test a Rest Hostbox request:
- Copy the URL of the desired Rest request within the Hostbox.
- Go to the API module and paste the Hostbox request's URL.
- Provide any required data (body, method parameters, headers, etc.).
- Send the request.
- Compare the actual response to the expected response.
- Make sure to start the Hostbox after simulating a request.
Follow the above steps and execute the simulated request in the API module. You will receive the simulated response body after request execution.
Repeat these steps for different requests within the Hostbox to thoroughly test your REST APIs efficiently.
Table of Contents