HTTP header
2016-06-03 00:50
435 查看
HTTP基于TCP协议之上的应用层协议,服务于Web浏览器和Web服务器的通信。是通用的、无状态的面向对象的协议。
PS: 无状态指的是同一个客户端的多次请求没有对应关系。
The header fields are transmitted after the request or response line, which is the first line of a message. (POST /rest/container HTTP/1.1)
Header fields are colon-separated name-value pairs in clear-text string format, terminated by a carriage return (CR) and line feed (LF) character sequence.(\r\n)
The end of the header section is indicated by an empty field, resulting in the transmission of two consecutive CR-LF pairs. (\r\n\r\n)
HTTP header fields by WIKI
PS: 无状态指的是同一个客户端的多次请求没有对应关系。
HTTP header
HTTP headers主要可分为:Request header & Response headerThe header fields are transmitted after the request or response line, which is the first line of a message. (POST /rest/container HTTP/1.1)
Header fields are colon-separated name-value pairs in clear-text string format, terminated by a carriage return (CR) and line feed (LF) character sequence.(\r\n)
The end of the header section is indicated by an empty field, resulting in the transmission of two consecutive CR-LF pairs. (\r\n\r\n)
HTTP header fields by WIKI
Request(GET) sample
GET https://10.103.201.165/rest/container HTTP/1.1 Host: 10.103.201.165 Accept-Encoding: gzip, deflate User-Agent: Fiddler ph-auth-token: S0NPFPd7kcaKbEq3CqTkaNTLRDxVQzUrb20ACmyFBFw=
Request(POST) sample
POST https://10.103.201.165/rest/container HTTP/1.1 Host: 10.103.201.165 Content-Length: 309 Accept-Encoding: gzip, deflate Accept: */* User-Agent: Fiddler Connection: keep-alive ph-auth-token: S0NPFPd7kcaKbEq3CqTkaNTLRDxVQzUrb20ACmyFBFw= {"status": "new", "description": "created container via REST", "sensitivity": "red", "data": {}, "severity": "high", "asset_id": 16, "name": "cap", "source_data_identifier": "100001", "label": "incident", "due_time": "2017-03-21T19:29:23.759Z", "start_time": "2016-03-21T19:28:13.759Z", "owner_id": "admin"}
Response sample
HTTP/1.1 200 OK Server: bfe/1.0.8.14 Date: Thu, 02 Jun 2016 09:30:54 GMT Content-Type: text/html;charset=utf-8 Connection: keep-alive Vary: Accept-Encoding Cache-Control: private Expires: Thu, 02 Jun 2016 09:30:54 GMT Set-Cookie: __bsi=12963635977989043210_00_182_N_N_120_0303_C027_N_N_N_0; expires=Thu, 02-Jun-16 09:30:59 GMT; domain=www.baidu.com; path=/ Content-Length: 73 {"errNo":"0","data": { "redDot": [ ], "newWord": [ ], "layer": [ ] }}
相关文章推荐
- Android Manifest 用法
- Android学习笔记(二九):嵌入浏览器
- RPC failed; result=22, HTTP code = 411
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- 峰回路转,Firefox 浏览器即将重返 iOS 平台
- HTTP Header 属性列表
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- 回顾 Firefox 历史
- 小白观察:微软释放出其基于 Chromium 的 Edge 浏览器
- 如何在 Linux 中快速地通过 HTTP 提供文件访问服务
- 浏览器 cookie 限制
- 深入HTTP head的使用详解
- Ruby程序中发送基于HTTP协议的请求的简单示例
- 玩转浏览器IE7的5个顶级使用技巧