当API响应状态码为200时,我可以很好地获取数据,但当API返回错误时,我无法从API检索错误消息。Spring webclient错误处理程序始终将消息显示为
但是当我使用PostMan时,ClientResponse has erroneous status code: 500 InternalServer Error会返回这个状态码为500的JSON响应。
我正在用PHP编写一个身份验证脚本,它需要返回200only in the case that it approves the request, and403(Forbidden) or500`。我遇到的问题是,php在出现错误的情况下返回200,而将错误输出为html。除非我自己显式返回HTTP 200或HTTP 403,否则我如何才能绝对确保php将返回HTTP 500代码?换句话说,我希望将任何和所有警告或错误