測試 Aglio 用的 API 文件
內容
-
這裡可以對這份文件做一點說明,可能包含 API 相關的一些限制和規定
-
可以使用包含程式碼區塊的 Markdown 語法
{
"result": true,
...
}
文章 ¶
文章 API
Create Post ¶
Create PostPOST/api/post/
create post
Example URI
POST https://aglio.practice/api/post/
Request
Headers
Content-Type: application/json
Body
{
"title": "test",
"content": "This is a test post."
}
Response
200
Headers
Content-Type: application/json
Body
{
"id": 1,
"title": "test",
"content": "This is a test post.",
"created_at": "2020/11/11"
}
Other Post api ¶
Get PostGET/api/post/{id}
get post
Example URI
GET https://aglio.practice/api/post/1
URI Parameters
- id
integer
(required) Example: 1post id
Response
200
Headers
Content-Type: application/json
Body
{
"id": 1,
"title": "test",
"content": "This is a test post.",
"created_at": "2020/11/11"
}
Update PostPUT/api/post/{id}
get post
Example URI
PUT https://aglio.practice/api/post/1
URI Parameters
- id
integer
(required) Example: 1post id
Request
Headers
Content-Type: application/json
Body
{
"title": "test_updated",
"content": "This is a test updated post"
}
Response
200
Headers
Content-Type: application/json
Body
{
"id": 1,
"title": "test_updated",
"content": "This is a test updated post",
"created_at": "2020/11/11"
}
Delete PostDELETE/api/post/{id}
delete post
Example URI
DELETE https://aglio.practice/api/post/1
URI Parameters
- id
integer
(required) Example: 1post id
Response
200