当前位置:网站首页>What is restful and what rules should be followed when designing rest APIs?
What is restful and what rules should be followed when designing rest APIs?
2022-06-22 16:34:00 【InfoQ】
What is? REST?
- English full name :
Representational State Transfer
- Chinese meaning : Presentation layer state transition
Fore and aft end separation

How to use REST API?
HTTP Verb
- GET: Used to read data from the server .
- POST: Used to create data .
- PATCH/PUT: Used to update data .
- DELETE: Used to delete data .

route
https://www.wljslmz.cn/users
https://www.wljslmz.cn/getUsers
https://www.wljslmz.cn/users
https://www.wljslmz.cn/user
https://www.wljslmz.cn/v1/users
https://www.wljslmz.cn/v1/users/1
https://www.wljslmz.cn/v1/users/page=1?limit=10
https://www.wljslmz.cn/v1/users/1/start-work
https://www.wljslmz.cn/v1/users/1/Start-Sork
https://www.wljslmz.cn/v1/users/1/start-work
https://www.wljslmz.cn/v1/users/1/Start-Sorkhttps://www.wljslmz.cn/v1/users/1/start-workhttps://www.wljslmz.cn/v1/users/1/start-workcommon HTTP Status code
- 1xxs: Information response , The server is still processing the request .
- 2xxs: success , Request completed successfully
- 3xxs: Redirect , The received request is redirected to another address .
- 4xxs: Client error , for example ,404 - Page not found .
- 5xxs: Server error , request was aborted .
- 200: A successful request , Usually GET
- 201: The request is successful after creation , Usually POST
- 204: The request is successful , No content returned , Usually PUT or PATCH
- 301: Permanently redirect to another endpoint
- 400: Wrong request ( The client should modify the request )
- 401: unaccredited , The credentials are not recognized
- 403: prohibit , Credentials accepted without permission
- 404: Not found , Resource does not exist
- 410: Vanished , The resource existed before but does not exist now
- 429: Too many requests , For rate limiting , Should contain retry header
- 500: Server error , generality , It's worth checking out other 500 Level error
- 503: Service not available , Another retry header is useful
summary
边栏推荐
猜你喜欢

IDEA安装总结

SAP 脚本教程:SE71、SE78、SCC1、VF03、SO10-013

SAP ABAP 内部表:创建、读取、填充、复制和删除-06

机器学习笔记 - HaGRID—手势识别图像数据集简介

超出文本部分用省略号表示

Shell learning

Runtime -- explore the nature of classes, objects, and classifications

Odoo local document function development record

CUMT study diary - quick notes of digital image processing examination

洞见科技牵头的全球「首个」IEEE隐私计算「互联互通」国际标准正式启动
随机推荐
5. reading and writing of documents (students)
数睿数据深度 | 关于软件自主可控,源代码向左,无代码向右
19、 Xv6 context switching (implementation of context switching; encapsulation and recovery of state machine)
Summary of safari compatibility issues
Uniapp wechat applet obtains page QR code (with parameters)
【C语言】库函数qsort的使用
预约打新债到底安不安全呀?是不是靠谱的?
SAP script tutorial: se71, se78, SCC1, vf03, so10-013
短视频源码开发,优质的短视频源码需要做好哪几点?
Runtime -- explore the nature of classes, objects, and classifications
SAP 脚本教程:SE71、SE78、SCC1、VF03、SO10-013
2.接口(计算器)
[Shanda conference] definitions of some basic tools
[Shanda conference] peer connection based on webrtc
论催收系统的任务调度设计
win10的wifi断线后无法连接
Modularity in SAP ABAP: macros, subroutines and function modules -04
超出文本部分用省略号表示
【微信小程序封装底部弹出框二】
nio文件和文件夹操作例子