There might be a few reasons why we would want to delay an HTTP request:
This approach makes use of the tweak browser extension. I'll use the tweak test application to delay an HTTP request that triggers a click in a UI element. There's a loading animation in place with a timer, so we can see the difference when actually delaying the HTTP request.
Here's how we set up the request to be delayed.
In the screenshot we have the request we're targeting to delay.
In this example we delay the request by 5 seconds.
Now that you've enabled the browser extension, you need to trigger that HTTP request that you want to delay (e.g., refresh the page if the request fires at page load, click on some UI element if the request is dispatched based on some user interaction).
After enabling the extension the targeted HTTP request is now delayed by 5 seconds.
You're now able to delay HTTP
requests across any environment, most importantly, without writing any code!
At any time, you can go back to the extension and tweak the delay value!
If the value is set to
0, no delay will be applied to your HTTP request.
You can consult the official documentation of the browser extension if you want to explore its other capabilities.
If you liked this article, consider sharing (tweeting) it to your followers.