1 Star 1 Fork 0

czlan91/05-chat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test.rest 2.50 KB
一键复制 编辑 原始数据 按行查看 历史

### signup user

POST http://localhost:6688/api/signup Content-Type: application/json

{
"workspace": "acme", "fullname": "Tyr Chen", "email": "tchen@acme.org", "password": "123456"

}

### signup user

POST http://localhost:6688/api/signup Content-Type: application/json

{
"workspace": "acme", "fullname": "Alice Chen", "email": "alice@acme.org", "password": "123456"

}

### signup user

POST http://localhost:6688/api/signup Content-Type: application/json

{
"workspace": "acme", "fullname": "Czlan", "email": "Czlan@acme.org", "password": "123456"

}

### signin user (valid)

POST http://localhost:6688/api/signin Content-Type: application/json

{
"email": "tchen@acme.org", "password": "123456"

}

### signin user

POST http://localhost:6688/api/signin Content-Type: application/json

{
"email": "Czlan@acme.org", "password": "123456"

} ### signin user (invalid)

# @name signin POST http://localhost:6688/api/signin Content-Type: application/json

{
"email": "tchen@acme.org", "password": "123456"

}

@token = {{signin.response.body.token}}

### create chat POST http://localhost:6688/api/chats Content-Type: application/json Authorization: Bearer {{token}}

{
"name": "acme2", "members": [1, 2], "public": false

}

### get chat list

GET http://localhost:6688/api/chats Authorization: Bearer {{token}}

### get user list

GET http://localhost:6688/api/users Authorization: Bearer {{token}}

### upload files

POST http://localhost:6688/api/upload Authorization: Bearer {{token}} Content-Type: multipart/form-data; boundary=MyBoundary

--MyBoundary Content-Disposition: form-data; filename="xdiff1.png" Content-Type: application/octet-stream

< /Users/tchen/snapshots/xdiff1.png --MyBoundary Content-Disposition: form-data; filename="hello.txt" Content-Type: text/plain

Hello, World! --MyBoundary--

### get files

GET http://localhost:6688/api/files/1/339/807/e635afbeab088ce33206fdf4223a6bb156.png Authorization: Bearer {{token}}

### send a message

POST http://localhost:6688/api/chats/1 Content-Type: application/json Authorization: Bearer {{token}}

{
"content": "Hello, World!", "files": []

}

### get messages

GET http://localhost:6688/api/chats/1/messages?limit=6&last_id=5 Authorization: Bearer {{token}}

### patch chat PATCH http://localhost:6688/api/chats/3 Content-Type: application/json Authorization: Bearer {{token}}

{
"members": [
1,2,3

], "name": "czlan", "public": true

}

### delete chat DELETE http://localhost:6688/api/chats/1 Authorization: Bearer {{token}}

Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/czlan91/05-chat.git
git@gitee.com:czlan91/05-chat.git
czlan91
05-chat
05-chat
master

搜索帮助