In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the difference between get and post requests in vue". In daily operation, I believe that many people have doubts about the difference between get and post requests in vue. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what is the difference between get and post requests in vue?" Next, please follow the editor to study!
Differences: 1. The parameters in the GET request follow the URL, that is, the parameters are placed in the header, while the parameters in the POST request are placed in the body, not after the URL. 2. The parameters that can be passed by get requests are small, while those passed by post requests are larger.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
The difference between get and post requests in vue
1. Get request
In the GET request, the parameter follows the URL, that is, the parameter is placed in the header. The parameters that can be transmitted are small. Use params.
This.$http.get ('URL') .then (result= > {if (result.status===0) {/ / successful this.list=result.message / / it is assumed that the list name in the requested data table is message} else {/ / failed, and the pop-up form warns alert ("data request failed");}})
2. Post request
In the POST request, the parameter is placed in the body and does not follow the URL. With data, the parameters passed are larger.
This.$http.post ('URL', {id:this.id}, {emulateJSON:true}).. then (result= > {if (result.body.status===0) {/ / succeeded} else {/ / failed alert ("failed to get data!") At this point, the study on "what is the difference between get and post requests in vue" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.