您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
03_HTTP_响应消息_响应行_状态码
发布时间:2022-08-15 22:44:37编辑:雪饮阅读()
在上篇案例我们做了用户登录的案例。
那么当我们直接访问http://localhost:8080/youku_war_exploded/User/Login而不是以post方法来访问时候会发现浏览器空白,因为我们doGet方法是空方法体,没有做任何东西。
但是假如你把doGet方法直接删除了则是不同的,再次重启后访问http://localhost:8080/youku_war_exploded/User/Login
则会在浏览器以405状态码响应的
响应源代码如:
<!doctype html><html lang="en"><head><title>HTTP Status 405 – Method Not Allowed</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 405 – Method Not Allowed</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> HTTP method GET is not supported by this URL</p><p><b>Description</b> The method received in the request-line is known by the origin server but not supported by the target resource.</p><hr class="line" /><h3>Apache Tomcat/8.5.31</h3></body></html>
关键字词:HTTP,响应消息,响应行,状态码
相关文章
- 05_HTTP_请求消息_请求行
- swoole携程风格http服务器带来的问题chrome浏览器重复
- swoole系列-在携程风格http服务器中实现异步"file_ge
- 基于GuzzleHttp(thinkphp5实现原生获取獲取微信公衆平
- workerman-websocket协议-websocket协议握手(get,serv
- http反向代理環境下获取真实ip(基於workerman)
- https在反向代理環境下获取真实ip(基於workerman實現)
- workerman作爲客戶端系列之http代理搭建
- workerman創建https服務(普通請求轉https請求,基於寶塔
- workerman創建https服務