# 五、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                                       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://close.gitbook.io/yun-wei-bi-ji/python/flask/wu-rest-jia-gou-api-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
