laravel PHP 中的 Http 响应代码枚举
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30547220/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Http response code enums in PHP
提问by mrwaim
I'm looking for something like HttpResponseCode::FileNotFound
=> 404, HttpResponseCode::OK
=> 200
我正在寻找类似HttpResponseCode::FileNotFound
=> 404, HttpResponseCode::OK
=> 200 的东西
I've searched for "php http status codes list", "php http status codes enum" and couldnt find anything.
我搜索了“php http 状态代码列表”、“php http 状态代码枚举”,但找不到任何内容。
回答by mrwaim
The term to search for is "php http status codes const" which leads you to http://symfony.com/blog/new-in-symfony-2-4-using-constants-for-http-status-code- It has \Illuminate\Http\Response::HTTP_NOT_FOUND
and \Illuminate\Http\Response::HTTP_OK
要搜索的术语是“php http 状态代码常量”,它会引导您到http://symfony.com/blog/new-in-symfony-2-4-using-constants-for-http-status-code- 它有\Illuminate\Http\Response::HTTP_NOT_FOUND
和\Illuminate\Http\Response::HTTP_OK
etc.
等等。
List is here - https://github.com/symfony/HttpFoundation/blob/master/Response.php
列表在这里 - https://github.com/symfony/HttpFoundation/blob/master/Response.php