Coder Social home page Coder Social logo

Comments (6)

feng99 avatar feng99 commented on May 29, 2024 3

POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POST

from spring-boot-api-project-seed.

posychiu avatar posychiu commented on May 29, 2024

代码生成类里的生成controller方法可以改模版

from spring-boot-api-project-seed.

gongwx avatar gongwx commented on May 29, 2024

谢谢

from spring-boot-api-project-seed.

shaolonger avatar shaolonger commented on May 29, 2024

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.

feng99 avatar feng99 commented on May 29, 2024

POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POST

Restful的标准可不是根据参数多少来的,而是根据对资源的定义,以及http状态码的定义。
可以参考的文章:https://medium.com/hackernoon/restful-api-designing-guidelines-the-best-practices-60e1d954e7c9

话虽如此, 实际使用中 我是强制要求,所有请求方式全部使用POST方式

from spring-boot-api-project-seed.

feng99 avatar feng99 commented on May 29, 2024

POST请求不暴漏请求参数在URL中
在请求用户数据 订单数据 等敏感数据时,有一定的保护作用.
虽然对专业人员没啥用,但是对行业外人员,有一定拦截作用.
另外,POST方式可传输的内容更大.
基本原则
参数少用GET 3-4个.
参数多用POST

Restful的标准可不是根据参数多少来的,而是根据对资源的定义,以及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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.