当前位置:网站首页>Advantages and disadvantages of rest ful API

Advantages and disadvantages of rest ful API

2022-07-07 23:08:00 Scale biubiu

advantage :

1. Suitable for high openness API. In recent years, the popularity of mobile Internet has diversified front-end devices , The industry urgently needs a unified mechanism to regulate API Design , bring API Suitable for all kinds of front end devices ,REST Meet this need .

2. Separation of behavior and resources , Easier to understand .

3. Propose to use version number ( for example v1、v2), More specification .

 

shortcoming :

1. High requirements for back-end developers , Business logic is sometimes difficult to be abstracted as the addition, deletion, modification and query of resources .

2. Not friendly to front-end developers ,API The grain size is coarse , It is difficult to query data that meets special requirements , The same business is better than ordinary API More than once HTTP request .
————————————————
Copyright notice : This paper is about CSDN Blogger 「UNT」 The original article of , follow CC 4.0 BY-SA Copyright agreement , For reprint, please attach the original source link and this statement .
Link to the original text :https://blog.csdn.net/qq_34098903/article/details/81116103

 

 

Personal view : I think the above great Xia's writing is very concise , and APP After communicating with front-end colleagues , Or decide not to use restful style , It will increase the difficulty of interface docking , It is also easy to make mistakes in the agreement , Conventional get/post The way , Clearly define interface functions , It's more convenient , And for safety , The difference is not big , Signature mechanism + secret key + Timestamps can also filter some of the hazards , So I decided not to use it for the time being . As for version number , We also according to our own situation , Combined with the experience of everyone on the Internet , I have defined the rules . It can be well adapted and compatible .

原网站

版权声明
本文为[Scale biubiu]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130600283711.html