How should I choose between GET and POST methods in HTML forms?

后端 未结 17 1614
醉话见心
醉话见心 2020-11-27 18:42

I wish to know all the pros and cons about using these two methods. In particular the implications on web security.

Thanks.

17条回答
  •  半阙折子戏
    2020-11-27 19:20

    To choose between them I use this simple rule:

    GET for reads. (reading data and displaying it)

    POST for anything that writes (i.e updating a database table, deleting an entry, etc.)

    The other consideration is that GET is subjected to the maximum URI length and of course can't handle file uploads.

    This page has a good summary.

提交回复
热议问题