Managing Mock Apis
This page provides a step-by-step guide to add and manage mock apis using Mocklets dashboard.
Once you have successfully created a collection, now its time to add mock APIs.(You can also import Open API Specifications to create mock APIs, we will discuss that approach in next chapter).
Mock Apis are the basic building blocks of Mocklets. A mock API is a combination of a URL endpoint, headers, HTTP method, and a predefined response body. You can set the API state (Running/Stopped) from the dashboard.
Sample api listing
There are 2 ways to add mock APIs to your Mocklets Collection, either adding mock APIs manually or through importing Open API Specifications. We will learn how to import Open API Specifications later.
Api create form
Let's walk through the steps of creating your first mock API.
Firstly, set a label, URL endpoint and HTTP method for your mock API. This concludes the request part of your API.
Now, its time to set the response for your API. Set appropriate HTTP status, headers(Content-Type, Content-Encoding), response delay(optional) and a response body. You can choose a data type for response body from Content-Type select.
You are all set, now click on Create Api button and your API is ready to be used.
Once the API is created, you can make modifications to it. Some of the features that our mock APIs offer is listed below.
These steps contain detailed feature descriptions and their functionality.