百度网盘链接 https://pan.baidu.com/s/1ktVbcQ9npIZDLA1NccyKQw
提取码 dres
123云盘链接 https://www.123pan.com/s/hU4tVv-x4iAH?
提取码 dres
服务器监听80端口
------ get、post请求方式
#get请求
http://127.0.0.1/get
#post请求
http://127.0.0.1/post
#js请求示例: URLSearchParams 用于处理键值对类型的数据,并将其编码为url查询字符串
new URLSearchParams({
name: '邓瑞',
web: 'dengruicode.com',
})
http://127.0.0.1/postJson
#js请求示例: JSON.stringify 用于将对象转换为json字符串
JSON.stringify({
name: '邓瑞编程',
web: 'www.dengruicode.com',
})
------ 项目实战
#文章列表
#请求url - 请求方式 [ get ]
http://127.0.0.1/article/get/all
#返回结果
{
"data": [
{
"id": 1,
"name": "邓瑞",
"title": "Vue3快速入门",
"web": "dengruicode.com"
},
{
"id": 2,
"name": "邓瑞",
"title": "Go项目实战",
"web": "www.dengruicode.com"
},
{
"id": 3,
"name": "邓瑞",
"title": "Ubuntu零基础入门",
"web": "bilibili.com"
}
],
"msg": "get请求",
"status": "success"
}
#获取文章
#请求url - 请求方式 [ get ]
http://127.0.0.1/article/get/id/1
#返回结果
{
"data": {
"id": 1,
"name": "邓瑞",
"title": "Vue3快速入门",
"web": "dengruicode.com"
},
"msg": "get请求",
"status": "success"
}
#请求url - 请求方式 [ get ]
http://127.0.0.1/article/get/search/title/入门
#返回结果
{
"data": [
{
"id": 1,
"name": "邓瑞",
"title": "Vue3快速入门",
"web": "dengruicode.com"
},
{
"id": 3,
"name": "邓瑞",
"title": "Ubuntu零基础入门",
"web": "bilibili.com"
}
],
"msg": "get请求",
"status": "success"
}
#请求url - 请求方式 [ post ]
http://127.0.0.1/article/postJson/search
#返回结果
{
"data": [
{
"id": 1,
"name": "邓瑞",
"title": "Vue3快速入门",
"web": "dengruicode.com"
},
{
"id": 3,
"name": "邓瑞",
"title": "Ubuntu零基础入门",
"web": "bilibili.com"
}
],
"msg": "post请求 [application/json]",
"status": "success"
}