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
Mocking Http-503 for a web service
Asked Answered
Perfect answer. Didn't know that was a thing. Thanks! –
Entablature
I really like this answer, I was searching exactly this. Thank you. –
Tramp
You can use the following Groovy script:
mockRequest.getHttpResponse().sendError(503)
the use : https://designer.mocky.io/ for test 503 http request
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
Use xml mimic, you can mock almost everything with http response without the need for real server.
© 2022 - 2024 — McMap. All rights reserved.