目录

HTTP的基础

Http方法与状态码

http方法

  • GET 拿
  • POST 发送
1
2
3
GET / HTTP/1.1     //GET请求根路径 使用HTTP1.1协议
Host: xiedaimala.com
User-Agent:  //用户代理(浏览器) 可根据查看相关信息

Http状态码 200请求成功。一般用于GET与POST请求

http猫

HTTP的header与body

重要的header

  • Accept
  • Cookie
  • User-Agent //浏览器标识
  • Referer //上一个页面是什么
1
Referer: http://idpeng.xyz/
  • Content-type //下载或者图片
1
content-type: text/html; charset=utf-8
  • Set-Cookie //登录后服务器自动设置的cookie

http是无状态的