Mock your API using saved response examples


Mock API's simulate API responses for testing and development purposes. This feature will provide predefined responses to API requests, allowing developers and testers to work independently of live external services.

Creating a Mock API

This guide will help you create a mock API using the interface provided.

Steps to Create a Mock API:

1. Navigate to the Mock API Creation Interface

  • Navigate to API Tests in left Navigation,Click on Mock API's
  • Locate the section titled Create New Mock API

2. Specify the API Endpoint

  • In the Endpoint field, enter the API endpoint URL that you would like to mock.
  • Example: /resource

3. Choose the HTTP Method

  • Use the dropdown next to HTTP Method to select the appropriate method for your mock API.
  • Available options:
    • GET
    • POST
    • PUT
    • DELETE

4. Define the API Response

  • In the Response field, enter a sample or expected response.
  • Example:
    { "status": "success" }
    
  • This response simulates what the real API would return in JSON format.

5. Save the Mock API

  • After completing the fields, click the Save button to create your mock API.

6. Test the API (Optional)

  • You can use tools like Postman or curl or CloudQA's API Testing to send requests and verify the behavior of your mock API.

By following these steps, you can quickly create and test a mock API for development or testing purposes.

results matching ""

    No results matching ""