postman连接mysql增删改查
作者:
GRUNMI | 来源:发表于
2019-04-28 11:23 被阅读0次一、连接数据库
postman连接数据库依赖xmysql,xmysql 依赖 7.6.0 以上版本的 node.js,node.js安装略过
- 安装
xmysql
命令:npm install xmysql -g
- 连接mysql命令:
xmysql -h localhost -o port -u username -p password -d dataname
连接mysql
这个时候mysql连接成功了,可以对数据库进行操作了
二、新增数据
请求方法 |
path |
完整路径 |
参数 |
POST |
/api/tableName |
http://localhost:3000/api/tableName |
{"id":"33"} |

实例
三、删除数据
请求方法 |
path |
完整路径 |
DELETE |
/api/tableName |
http://localhost:3000/api/tableName/primary key |

实例
四、修改数据
请求方法 |
path |
完整路径 |
参数 |
PATCH |
/api/tableName |
http://localhost:3000/api/tableName/primary key |
{"vehicle_level":"10"} |

实例
四、查询数据
请求方法 |
path |
完整路径 |
参数 |
GET |
/api/tableName |
http://localhost:3000/api/tableName/primary key |
|
GET |
/api/tableName |
http://localhost:3000/api/tableName |
_where=(id,eq,1) |

实例
更多用法请看官方文档==>>
xmysql官方文档
本文标题:postman连接mysql增删改查
本文链接:https://www.haomeiwen.com/subject/fgdskqtx.html
网友评论