GET vs. POST (form processing)

前端 未结 4 1017
野趣味
野趣味 2020-12-19 10:18

I completely understand the differences between the two in terms of form handling, user discretion and privacy of data, but in what situation would anyone rather use GET ove

4条回答
  •  借酒劲吻你
    2020-12-19 10:40

    W3C HTML 4.01 Recommendation on the appropriate usage of GET and POST:

    The "get" method should be used when the form is idempotent (i.e., causes no side-effects). Many database searches have no visible side-effects and make ideal applications for the "get" method.

    If the service associated with the processing of a form causes side effects (for example, if the form modifies a database or subscription to a service), the "post" method should be used.

    Note: The "get" method restricts form data set values to ASCII characters. Only the "post" method (with enctype="multipart/form-data") is specified to cover the entire [ISO10646] character set.

提交回复
热议问题