HTTP 方法參考
所有 HTTP 方法的完整參考指南,包含屬性、使用案例和常見狀態碼
所有處理皆在瀏覽器中完成,不會上傳任何資料。
HTTP 方法參考
所有 HTTP 方法的完整參考指南,包含屬性、使用案例和常見狀態碼
🔒所有處理皆在瀏覽器中完成,不會上傳任何資料。
依方法名稱、描述或使用案例搜尋...
快速比較
| 方法 | 安全 | 冪等 | 可快取 | 請求主體 | 回應主體 |
|---|---|---|---|---|---|
GET | 是 | 是 | 是 | 選填 | 是 |
HEAD | 是 | 是 | 是 | 選填 | No |
POST | No | No | No | 是 | 是 |
PUT | No | 是 | No | 是 | 選填 |
PATCH | No | No | No | 是 | 是 |
DELETE | No | 是 | No | 選填 | 選填 |
OPTIONS | 是 | 是 | No | 選填 | 是 |
TRACE | 是 | 是 | No | No | 是 |
CONNECT | No | No | No | No | 是 |
方法詳情
GET
Retrieve a representation of the specified resource. GET requests should only retrieve data.HEAD
Same as GET, but the server must not return a message body in the response.POST
Submit data to the specified resource, often causing a change in state or side effects on the server.PUT
Replace the entire target resource with the request payload.PATCH
Apply partial modifications to a resource.DELETE
Remove the specified resource from the server.OPTIONS
Describe the communication options for the target resource.TRACE
Perform a message loop-back test along the path to the target resource.CONNECT
Establish a tunnel to the server identified by the target resource.屬性定義
安全:如果方法不會改變伺服器狀態,則為安全方法。換句話說,如果方法執行的是唯讀操作,則為安全方法。安全方法可以被快取和預先擷取而無風險。
冪等:如果單次請求對伺服器的預期效果與多次相同請求的效果相同,則該方法為冪等的。所有安全方法都是冪等的,PUT 和 DELETE 也是冪等的。
可快取:可快取回應是可以被快取以供後續請求重複使用的 HTTP 回應。GET 和 HEAD 回應通常是可快取的。
