为 Web 服务模拟 Http-503

Daw*_*wit 3 web-services mocking soapui osb

当服务器由于服务器临时过载或维护而无法处理请求时,我想模拟 HTTP 503(错误 503--服务不可用)的 Web 服务响应。最好的策略是什么?感谢:D

thd*_*oan 5

这是我使用的:

https://httpstat.us/503

无需外部软件或依赖项。


小智 2

您可以使用以下 Groovy 脚本:

mockRequest.getHttpResponse().sendError(503)
Run Code Online (Sandbox Code Playgroud)