简体   繁体   中英

Axios/express GET/POST/PUT/DELETE

In express router and Axios (and many other frameworks/APIs), you can use GET/POST/PUT/DELETE.

Why do you specify these, what are the differences?

I understand that a GET is used the get the data, and a POST to post the data.

But even if you use an Axios.post to get data it works just fine if you set up the API endpoint to send the data back.

Is there any technical differences or is it just out of good practice and readability.

It is possible to use HTTP methods in a "non-traditional" way, according to your example, this works. However, it is not a good practice to use them like this, it is best to follow the good practices and constraints of REST

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM