> For the complete documentation index, see [llms.txt](https://docs.mocklets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mocklets.com/managing-mock-apis/response-delay.md).

# Response Delay

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.

![Setting Response delay to api](/files/-Ldt2zyhLAu4DapsqE8n)

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.

You can also control the delay duration using query params. Please refer this [link](https://docs.mocklets.com/managing-mock-apis/using-query-params) for more.

{% hint style="info" %}
**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.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mocklets.com/managing-mock-apis/response-delay.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
