Comments (6)
POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POST
from spring-boot-api-project-seed.
代码生成类里的生成controller方法可以改模版
from spring-boot-api-project-seed.
谢谢
from spring-boot-api-project-seed.
POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POST
Restful的标准可不是根据参数多少来的,而是根据对资源的定义,以及http状态码的定义。
可以参考的文章:https://medium.com/hackernoon/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9
from spring-boot-api-project-seed.
POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POSTRestful的标准可不是根据参数多少来的,而是根据对资源的定义,以及http状态码的定义。
可以参考的文章:https://medium.com/hackernoon/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9
话虽如此, 实际使用中 我是强制要求,所有请求方式全部使用POST方式
from spring-boot-api-project-seed.
POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POSTRestful的标准可不是根据参数多少来的,而是根据对资源的定义,以及http状态码的定义。 可以参考的文章:https://medium.com/hackernoon/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9
是的 后来我发现根据参数数量来选择get post并不靠谱
应该根据对数据是读取还是修改的行为来定义.
但是往往在数据读取中 依然伴随着数据的修改.(统计数据)
所以,最后经过技术部门的一致讨论,决定全部使用post方式,
且请求和返回数据的格式都使用json.
这样使用postman模拟请求也比较方便.
from spring-boot-api-project-seed.
Related Issues (20)
- 建议视频放在B站 HOT 5
- {"code":500,"message":"接口 [/thetrainlist/list/] 内部错误,请联系管理员"} HOT 2
- 为啥我生成了3个文件夹,不是包呢。
- 请问有将springboot升级到2.X计划吗?有的话大概什么时候?
- 根据添加的依赖生成对应的application配置
- 建议把Controller、Service、DAO和和三方对接的模板都写一下
- 验签拦截器获取不到请求头中的数据
- "message": "接口 [/user/add] 内部错误,请联系管理员"
- "message": "接口 [/user/add] 内部错误,请联系管理员"bug已解决 HOT 2
- resource下面没有mapper文件 HOT 3
- 前后端分离项目,vue+boot,针对这个工程里面有需要改动的地方吗?
- 去掉fastjson的依赖吧 HOT 1
- 【招聘向】大厂机会,将这个项目应用到生产吧 HOT 1
- 停更了? HOT 1
- 返回的对象是空,是什么原因 HOT 2
- 大佬加个相关项目链接呗 HOT 1
- 【项目自荐】: ❤️一个基于Springboot的个人博客 HOT 1
- 来个 springboot2.x最新版的吧?1.5有些老了?
- 建议
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot-api-project-seed.