Lokvin Wiki
Advertisement

http header[]

Increasing Application Performance with HTTP Cache Headers[]

http message 组成[]

  • start line (起始行)
  • header (首部)
  • body (主体)

request message format[]

<method> <request-URL> <version>
<headers>

<entity-body>
GET /test/hi-there.txt HTTP/1.1
Accept: */*
Host: www.joes-hardware.com

response message format[]

<version> <status> <reason-phrase>
<headers>

<entity-body>
HTTP/1.0 200 OK
Content-type: text/plain
Content-length: 19

Hi! I'm message!

HTTP Method[]

方法 描述 是否包含主体
GET 从服务器获取文档 NO
HEAD 只从服务器获取文档首部 NO
POST 向服务器发送需要处理的数据 YES
PUT 将请求的主体部分存在服务器上 YES
TRACE 对可能经过代理服务器传送到服务器上的报文进行追踪 NO
OPTIONS 决定可以在服务器上执行哪些方法 NO
DELETE 删除服务器上的文档 NO


HTTP response code[]

  • 状态码分类
整体范围 已定义范围 分类
100 ~ 199 100 ~ 101 信息提示
200 ~ 299 200 ~ 206 成功
300 ~ 399 300 ~ 305 重定向
400 ~ 499 400 ~ 415 客户端错误
500 ~ 599 500 ~ 505 服务器端错误

two Content-Type header for form submission[]

Content-Type: application/x-www-form-urlencoded  # default for html forms
Content-Type: multipart/form-data # used when form contains files, non-ascii, binary data
Advertisement