在客户端请求到达服务器后,我会进行操作,如果请求数据操作失败(保存到数据库失败),我想返回客户端的状态码为400.这时候却一直是200,怎么修改状态码呢
认证0级讲师
You can set the response result in the header, for example
header(‘HTTP/1.1 404 Not Found’);
You can set the response result in the header, for example