简体   繁体   中英

why to use post in restful web services in Lehman languages

为什么我要使用勒曼语言在宁静的Web服务中使用post,所以我可以使用@GET并发送一个get请求,那么它也会获取或修改数据,使用@GET或@post只是一个约定,否则会导致一些技术难度。

In addition to what ivant said, there is also the issue of maximum request header size accepted by the server.

For GET requests it's usually about 8KB, whereas it's about 2GB for POST requests.

See this question for more details about size limits.

It's more like part of the definition of REST. That is, it won't be REST if you modify the data using GET.

There is a more technical side to this as well: REST is designed to work well with existing infrastructure, like proxies. Normally GET request can be cached by proxies, while POST, PUT or DELETE cannot, because they change stuff. If you change stuff in GET, you'll have to specifically add headers to instruct any proxies against caching this request or risk getting quite strange and unexpected results.

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