GET vs. POST ajax requests: When and how to use either?

后端 未结 4 563
野的像风
野的像风 2020-12-15 05:01

What are the strengths of GET over POST and vice versa when creating an ajax request? How do I know which I should use at any given time? Is it a security-minded decision?

4条回答
  •  独厮守ぢ
    2020-12-15 05:37

    POST requests are requests that you do not want to accidentally happen. GET requests are requests you are OK with happening by a user pointing a browser to via a URL.

    GET requests can be repeated quite simply since their data is based in the URL itself.

    You should think about AJAX requests like you think about regular form requests (and their GET and POST)

提交回复
热议问题