A test service to mock a slow http response.
A test service to mock a slow api response - simply prepend your Slowwly URL with delay configuration to your usual API URL and make a request, the response will be delayed.
This can be used to simulate timeouts so that you can see how your application responds with slow API requests or if it fails where you expect it to fail.
There are other services doing this but Slowwly will respond to
POST requests as well as
Example URL with request delayed by 2 seconds -
Try it out
Slowwly is deployed @http://slowwly.robertomurray.co.uk/ so go ahead and use it or run locally.
Example URL with request delayed by 2.5 seconds -
This project aims to;
- Provide delayed response for at least
- Not intefere too much with calling code making the request. We don't want users to have to modify request params to use this, editing code just to test something is a pain - the request host or URL should be the minimum required change to use this.
- Return redirect after delay; It is useful to actually see how you code works with the real response returned after a delay. Note: obviously requires clients to follow redirects ;)
It's a simple Rack app so you can run it anywhere;
$ git clone firstname.lastname@example.org:rob-murray/slowwly.git $ cd slowwly $ rackup # Or with foreman $ foreman start
Feel free to run it anywhere you need or use the existing deployed service here.
Build a URL with the following params:
- The host where this app is running
- Time to delay response in milliseconds
- The URL to redirect to via response
Slowwly responds to the following HTTP methods as below;
- Responds with HTTP
- Responds with HTTP
# a simple get request with 1 second delay $ curl -i http://localhost:9292/delay/1000/url/https://www.google.co.uk HTTP/1.1 302 Found Content-Type: text/html;charset=utf-8 Location: https://www.google.co.uk Content-Length: 0 # etc # a post request with some data and a 3 second delay $ curl -i --data "param1=value1" http://localhost:9292/delay/3000/url/http://myapi.com/endpoint HTTP/1.1 307 Temporary Redirect Content-Type: text/html;charset=utf-8 Location: http://myapi.com/endpoint Content-Length: 0 # etc
Development / Deployment
This application is available as a
latest cool thing Docker image at robmurray/slowwly-web.
Run it yourself with:
docker pull robmurray/slowwly-web docker build -t <tag> docker run -d -p 8080:8080 --name <name> -t <tag>
Please use the GitHub pull-request mechanism to submit contributions.
This project is available for use under the MIT software license. See LICENSE