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

Was this helpful?

  1. Managing Mock Apis

Response Delay

PreviousRandomised ResponsesNextUsing Query Params

Last updated 6 years ago

Was this helpful?

Requests over a network to an API can be delayed for many reasons e.g. network congestion or excessive server load. For applications to be resilient they must be designed to handle these inevitable variabilities and tested to ensure optimum end user's experience, even when the back-end APIs are not working properly.

Mocklets provides a very easy way to test applications against these unexpected delays in back-end APIs. Mocklets lets you set response delays to each response, so you can test your application against different HTTP status codes and their respective delays.

The above api will respond with a delay of 10 seconds.

Whenever Mocklets is instructed to add a delay in response, it adds a header x-mocklets-delay to the response.

Please note If the API is set to forward the request to the Proxy server, delay settings will be ignored and response will be returned as soon as the proxy server responds.

You can also control the delay duration using query params. Please refer this for more.

link
Setting Response delay to api