> For the complete documentation index, see [llms.txt](https://close.gitbook.io/yun-wei-bi-ji/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://close.gitbook.io/yun-wei-bi-ji/python/flask/wu-rest-jia-gou-api-fang-fa.md).

# 五、REST架构API方法

## REST架构API中使用的HTTP请求方法

| 请求方法   | 目　标   | 说　　明 | HTTP状态码                                                |
| ------ | ----- | ---- | ------------------------------------------------------ |
| GET    | 单个资源的 | URL  | 获取目标资源 200                                             |
| GET    | 资源集合的 | URL  | 获取资源的集合（如果服务器实现了分页，就是一页中的资源） 200                       |
| POST   | 资源集合的 | URL  | 创建新资源，并将其加入目标集合。服务器为新资源指派 URL，并在响应的 Location 首部中返回 201 |
| PUT    | 单个资源的 | URL  | 修改一个现有资源。如果客户端能为资源指派 URL，还可用来创建新资源 200                 |
| DELETE | 单个资源的 | URL  | 删除一个资源 200                                             |
| DELETE | 资源集合的 | URL  | 删除目标集合中的所有资源 200                                       |
