forked from mtusi2026/mtusi2026lab3
feat: полная реализация
This commit is contained in:
+31
-13
@@ -1,23 +1,41 @@
|
||||
POST /api/auth/login HTTP/1.1
|
||||
Host: localhost:8080
|
||||
### Health
|
||||
GET http://localhost:8080/health
|
||||
|
||||
### Login
|
||||
POST http://localhost:8080/api/auth/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"login": "user",
|
||||
"password": "password"
|
||||
"login": "test",
|
||||
"password": "test123"
|
||||
}
|
||||
|
||||
POST /api/messages HTTP/1.1
|
||||
Host: localhost:8080
|
||||
### Get messages
|
||||
GET http://localhost:8080/api/messages
|
||||
Authorization: Bearer TOKEN_HERE
|
||||
|
||||
### Send message
|
||||
POST http://localhost:8080/api/messages
|
||||
Authorization: Bearer TOKEN_HERE
|
||||
Idempotency-Key: unique-key-123
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer <token>
|
||||
Idempotency-Key: <idempotency-key>
|
||||
|
||||
{
|
||||
"recipient": "user",
|
||||
"body": "Hello, World!"
|
||||
"recipient": "test",
|
||||
"body": "Hello Bob"
|
||||
}
|
||||
|
||||
GET /api/messages HTTP/1.1
|
||||
Host: localhost:8080
|
||||
Authorization: Bearer <token>
|
||||
### Send the same message again (idempotent replay, same body and same key)
|
||||
POST http://localhost:8080/api/messages
|
||||
Authorization: Bearer TOKEN_HERE
|
||||
Idempotency-Key: unique-key-123
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"recipient": "test",
|
||||
"body": "Hello Bob"
|
||||
}
|
||||
|
||||
### Logout
|
||||
POST http://localhost:8080/api/auth/logout
|
||||
Authorization: Bearer TOKEN_HERE
|
||||
|
||||
Reference in New Issue
Block a user