Mocklets
  • Getting Started
  • Working with Collections
    • Create Collection
    • Invite Members
  • Managing Mock Apis
    • Dynamic Responses
    • URL Regex Matching
    • Use API as Proxy
    • Randomised Responses
    • Response Delay
    • Using Query Params
    • API Comments
  • Manage your files
  • Open API Specifications 3.x
  • Integration with external editors
  • Response Headers
  • Monitor Request Logs
  • Secure your mock APIs
  • Important Links
    • Home
    • Dashboard
    • Privacy Policy
    • Terms of Use
Powered by GitBook
On this page
  • Configure HTTP Status
  • Configure Response delay

Was this helpful?

  1. Managing Mock Apis

Using Query Params

When working on a mock API, you will often need to configure your API in a way that will affect the working of the rest of your team. So to handle those scenarios, Mocklets enables you to control some of the configuration using query params while making the API request.

Currently, we allow users to configure response HTTP status and delay parameters by adding query params to their API calls.

Configure HTTP Status

You can request a specific HTTP status in response by adding x_response_status param to your api. So, if you api is https://api.mocklets.com/mock12675/pets which has its active response HTTP status set as 200, but you want it to return a 401 response, you just have to call

https://api.mocklets.com/mock12675/pets?x_response_status=401

Please note You need to add the requested status code to your api, otherwise it will return 404 NOT FOUND error.

Configure Response delay

User can add custom delay to the api request using query param without effecting the behavior of other team members using the same api. You need to add x_response_delay param to you api. So, if your api is https://api.mocklets.com/mock12675/pets and you want to set the delay as 15 seconds, you have to call

https://api.mocklets.com/mock12675/pets?x_response_delay=15

The maximum delay supported in 60 seconds, any value above it will be ignored and 60 second delay will be set for that request.

We are adding more configuration that can be managed using query params. Please stay tuned for more.

PreviousResponse DelayNextAPI Comments

Last updated 6 years ago

Was this helpful?