Mocking Http-503 for a web service
Asked Answered
Z

4

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

Zeb answered 18/4, 2013 at 2:25 Comment(0)
I
16

Here's what I use:

https://httpstat.us/503

No external software or dependencies required.

Islet answered 21/9, 2018 at 6:24 Comment(2)
Perfect answer. Didn't know that was a thing. Thanks!Entablature
I really like this answer, I was searching exactly this. Thank you.Tramp
K
2

You can use the following Groovy script:

mockRequest.getHttpResponse().sendError(503)
Karyogamy answered 18/4, 2013 at 20:6 Comment(0)
S
2

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

Stay answered 17/11, 2020 at 17:48 Comment(1)
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?Maroney
E
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/

Ethelynethene answered 18/3, 2014 at 9:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.