【发布时间】:2017-01-26 19:29:14
【问题描述】:
我正在尝试在我的 AngularJS 应用程序中返回 401 响应状态。但在我看到的控制台中,它返回 -1
我在php中使用的:
header("HTTP/1.1 401 Unauthorized");
http_response_code(401);
也在codeigniter中:
$this->output->set_header('HTTP/1.1 401 Unauthorized');
$this->output->set_status_header(401, "my status text");
它在状态代码中运行良好,例如:200、205、206 等。
有什么想法吗?
【问题讨论】:
标签: php angularjs codeigniter http-status-code-401 http-response-codes