HTTP Method小結(GET,POST.etc)
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:
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:
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
GET vs POST :除了大小不同,前者能儲存書籤,後者不是冪等性的,表單預設是GET方式提交除非指定method=post
API
http://www.php230.com/weixin1418947689.html
1. 之前看謝大分享了這本電子書《Web API Design》,挺不錯的,截圖也來自這書
原地址:
謝大搬到國內的地址: 密碼:HG7K - XiangZ
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26477398/viewspace-2122428/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- form&method【POST~GET】ORM
- method=post/get區別記錄
- c#之tcbs method方法_getC#
- [前端 · 面試 ]HTTP 總結(五)—— GET 和 POST前端面試HTTP
- X-HTTP-Method-Override和Http Extension框架HTTPIDE框架
- HTTP知識點小結HTTP
- axios 發get,post 請求小結iOS
- SimpleUI [12/Mar/2024 19:32:11] "GET /admin/logout/ HTTP/1.1" 405 0 Method Not AllowedUIGoHTTP
- IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensExceptionHTTP
- Tomcat、http、get/postTomcatHTTP
- .woff HTTP GET 404 (Not Found)HTTP
- HTTP GET請求傳bodyHTTP
- HTTP方法_GET 對比 POSTHTTP
- HTTP Get,Post請求詳解HTTP
- NHibernate “login: method get_Upwd should be virtual”錯誤解答!
- node.js http.get 和http.post 資料Node.jsHTTP
- http獲取get引數過濾HTTP
- HTTP中GET與POST的區別HTTP
- Java Http Get Post 請求工具類JavaHTTP
- php中$_REQUEST、$_POST、$_GET的區別和聯絡小結PHP
- ORA-29531: no method get_crlf in class oracle/plsql/net/TCPConnectionOracleSQLTCP
- apt-get用法小記apt-get
- Http請求get與post請求方式的各種相關面試總結HTTP面試
- http中的get和post的區別HTTP
- java傳送http的get、post請求JavaHTTP
- Http get,post,soap協議的區別HTTP協議
- go 結構體 (struct) 和方法 (method)Go結構體Struct
- java springboot http get請求 URLConnection get 返回值 亂碼JavaSpring BootHTTP
- orm的method屬性值post和get的區別簡單介紹ORM
- http請求之get和post的區別HTTP
- HTTP協議類POST 和GET的區別HTTP協議
- Go使用net/http庫傳送GET請求GoHTTP
- ABAP的HTTP_GET和Linux的curlHTTPLinux
- HTTP中Get與Post有什麼區別?HTTP
- HTTP協議 GET和POST的左右互博HTTP協議
- Go HTTP GET 請求可以傳送 body 嗎GoHTTP
- 淺談HTTP中Get與Post的區別HTTP
- Http協議中Get和Post的淺談HTTP協議