美文网首页
006-http请求状态吗

006-http请求状态吗

作者: mo371 | 来源:发表于2019-06-05 22:24 被阅读0次
1、HTTP请求:

客户端--request-->服务端
客户端<--response--服务端

request --包含请求行、请求头部、请求数据
respost --包含状态行、消息报头、响应正文

[root@VM_0_4_centos ~]# curl -v http://www.abcdocker.com >/dev/null 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to www.abcdocker.com port 80 (#0)
*   Trying 59.110.69.51...
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0* Connected to www.abcdocker.com (59.110.69.51) port 80 (#0)
> GET / HTTP/1.1                                     //请求方法 url 协议/版本号
> User-Agent: curl/7.29.0
> Host: www.abcdocker.com                            //主机地址
> Accept: */*
> 
< HTTP/1.1 301 Moved Permanently
< Server: AbcDocker/1.1.1.1
< Date: Sat, 13 Oct 2018 14:07:22 GMT
< Content-Type: text/html
< Content-Length: 190
< Connection: keep-alive
< Location: https://www.abcdocker.com/

{ [data not shown]
100   190  100   190    0     0    117      0  0:00:01  0:00:01 --:--:--   117
* Connection #0 to host www.abcdocker.com left intact
常见状态代码、状态描述的说明如下。
200 OK:客户端请求成功。
400 Bad Request:客户端请求有语法错误,不能被服务器所理解。
401 Unauthorized:请求未经授权,这个状态代码必须和WWW-Authenticate报头域一起使用。
403 Forbidden:服务器收到请求,但是拒绝提供服务。
404 Not Found:请求资源不存在,举个例子:输入了错误的URL。
500 Internal Server Error:服务器发生不可预期的错误。
503 Server Unavailable:服务器当前不能处理客户端的请求,一段时间后可能恢复正常,举个例子:HTTP/1.1 200 OK(CRLF)

相关文章

网友评论

      本文标题:006-http请求状态吗

      本文链接:https://www.haomeiwen.com/subject/nvdexctx.html