http协议的四个部分:method,url,header,body
(PATH_INFO, URL Query String, Headers, Body)
PATH_INFO(path路径方式)
http://baidu.com/name/xiaoming/age/12
URL Query String (url查询字符串,以"?"作为标志)
这种在各种method(get,post,delete,put)都能使用,解析速度快
http://baidu.com/?name=xiaoming&age=13
Body(post方法)
(Content-Type: application/x-www-form-urlencoded;charset=utf-8、Content-Type: multipart/form-data、Content-Type: application/json;charset=utf-8(本来是响应头,但是普遍用在请求头))
Headers
curl --header 'token: 40d7c342c110414888cc2a0e1284c636' -H 'content-type:application/json' -X GET http://www.baidu.com
所有方法都可以,键值对形式