HTTP Method小结(GET,POST.etc)
来源:互联网 发布:矿泉水国家标准数据 编辑:程序博客网 时间:2024/06/04 23:24
GET 从指定的url上获取内容
POST 提交body中的内容给服务器中指定的url中,属于非幂等的(non-idempotent)请求
HEAD 从指定的url上获取header内容(类似Get方式)
TRACE Allows a programmer to see how the client's message is modified as it passes through a series of proxy servers. The recipient of a TRACE method echoes the HTTP request headers back to the client
PUT 将body上传至服务器指定url处
DELETE 在指定url处删除资源
OPTIONS 获取指定url中能接收的请求方法
CONNECT 连接指定频段。当客户端需要通过代理服务器连接HTTPS服务器是用到。
1.GET
例子:
GET /select/selectBeerTaste.jsp?color=dark&taste=malty HTTP/1.1
Host: www.wickedlysmart.com
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/ 20030624 Netscape/7.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/
plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
2.POST
例子:
POST /advisor/selectBeerTaste.do HTTP/1.1
Host: www.wickedlysmart.com
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/ 20030624 Netscape/7.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/
plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
color=dark&taste=malty
GET vs POST :除了大小不同,前者能保存书签,后者不是幂等性的,表单默认是GET方式提交除非指定method=post
- HTTP Method小结(GET,POST.etc)
- HTTP Method小结(GET,POST.etc)
- HTTP Method小结(GET,POST.etc)
- HTTP Method小结(GET,POST.etc)
- HTTP Method小结(GET,POST.etc)
- HTTP GET/POST/PUT/DELETE小结
- HTTP Status 405 - HTTP method GET(POST) is not supported by this URL
- 淺談 HTTP Method:表單中的 GET 與 POST 有什麼差別?
- http表单中method的post与get区别
- HTTP 405 method GET/POST is not supported
- HTTP Method 小结
- HTTP Status 405 - HTTP method POST/GET is not supported by this URLyi
- <form> 表单里的method(post/get)方法
- GET PUT POST的含义(Http)
- GET PUT POST的含义(Http)
- Android中的HTTP请求(GET/POST)
- Android Http协议(post get)
- Angularjs $http 请求数据(get.post)
- 191Numberof1Bits
- Android 获取唯一机器码的代码
- 【移动适配】移动Web怎么做屏幕适配(一)
- 【poj3368】Frequent values 线段树 区间最高频
- 获取keyWindow
- HTTP Method小结(GET,POST.etc)
- iOS 上传应用到Appstore遇到的问题 Your app is using the Advertising Identifier (IDFA)
- 操作系统进程调度算法
- cs120_lab1b作业答案
- Tapestry框架概述
- javascript对象和php对象和json区别
- Dockerfile 语法
- 371. Sum of Two Integers
- Impala问题汇总