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
- SimpleUI [12/Mar/2024 19:32:11] "GET /admin/logout/ HTTP/1.1" 405 0 Method Not AllowedUIGoHTTP
- [前端 · 面試 ]HTTP 總結(五)—— GET 和 POST前端面試HTTP
- IllegalArgumentException: Invalid character found in method name. HTTP method names must be tokensExceptionHTTP
- axios 發get,post 請求小結iOS
- HTTP GET請求傳bodyHTTP
- java springboot http get請求 URLConnection get 返回值 亂碼JavaSpring BootHTTP
- Java Http Get Post 請求工具類JavaHTTP
- http獲取get引數過濾HTTP
- ABAP的HTTP_GET和Linux的curlHTTPLinux
- go 結構體 (struct) 和方法 (method)Go結構體Struct
- Android技能樹 — 網路小結(3)之HTTP/HTTPSAndroidHTTP
- Http請求get與post請求方式的各種相關面試總結HTTP面試
- HTTP協議類POST 和GET的區別HTTP協議
- HTTP中Get與Post有什麼區別?HTTP
- Go HTTP GET 請求可以傳送 body 嗎GoHTTP
- HTTP協議 GET和POST的左右互博HTTP協議
- http請求之get和post的區別HTTP
- Go使用net/http庫傳送GET請求GoHTTP
- http請求中get和post方法的區別HTTP
- 使用CloseableHttpClient 訪問 http 和https 的get請求HTTPclient
- HTTP/1.x 及 Service Worker 快取實踐小結HTTP快取
- HTTP總結HTTP
- Numerical Results of RhDYas CG method and RhLHas CG method
- http和https的區別/get和post的區別HTTP
- 除了GET方法,新的HTTP QUERY方法規範釋出HTTP
- Kernel Method
- Swizzling Method
- Greedy Method
- post、get的區別總結
- HTTP的結構HTTP
- 遇到403 Forbidden ,伺服器端查詢後結果是http get查詢字串中包含非法字元ORB伺服器HTTP字串字元
- 網路通訊5:執行HTTP的GET/POST請求HTTP
- 你真的瞭解HTTP中GET與POST的區別嗎?HTTP
- 淺談HTTP中GET和POST請求方式的區別HTTP
- http協議中,“get”和“post”的區別是什麼HTTP協議
- [前端 · 面試 ]HTTP 總結(一)—— HTTP 概述前端面試HTTP
- get與post的區別總結
- Two Pointer Method