5

I would like to mock a web service response for an HTTP 503 (Error 503--Service Unavailable) when The server is unable to handle the request due to a temporary overloading or maintenance of the server. What is the best strategy? Thanks, D

Dharman
  • 30,962
  • 25
  • 85
  • 135
Dawit
  • 61
  • 1
  • 4

4 Answers4

13

Here's what I use:

https://httpstat.us/503

No external software or dependencies required.

thdoan
  • 18,421
  • 1
  • 62
  • 57
2

You can use the following Groovy script:

mockRequest.getHttpResponse().sendError(503)
Virtum
  • 21
  • 2
1

Use xml mimic, you can mock almost everything with http response without the need for real server.

http://sourceforge.net/projects/xmlmimic/

http://sourceforge.net/projects/xmlmimic/

1

the use : https://designer.mocky.io/ for test 503 http request

  • 2
    Good start for helping out in answering this question! Your answer could be a bit better if it provided an example of how to use the tool. Maybe provide a basic example? – Lenna Nov 17 '20 at 18:29