blog icon indicating copy to clipboard operation
blog copied to clipboard

GET与POST异同

Open LiuL0703 opened this issue 7 years ago • 0 comments

POST & GET 区别

  • GET的url 可被手动输入 可被浏览器缓存 可存为书签
  • GET是幂等
  • POST是非幂等 不可被缓存
  • POST并不比GET更加安全

何时使用:

Quick Checklist for Choosing HTTP GET or POST Use GET if:The interaction is more like a question (i.e., it is a safe operation such as a query, read operation, or lookup).

Use POST if:The interaction is more like an order, or The interaction changes the state of the resource in a way that the user would perceive (e.g., a subscription to a service), or The user be held accountable for the results of the interaction.However, before the final decision to use HTTP GET or POST, please also consider considerations for sensitive data and practical considerations.

LiuL0703 avatar Jan 02 '18 11:01 LiuL0703