Files
mtusi2026lab4/examples/requests.http
T

42 lines
821 B
HTTP

### Health
GET http://localhost:8080/health
### Login
POST http://localhost:8080/api/auth/login
Content-Type: application/json
{
"login": "test",
"password": "test123"
}
### 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
{
"recipient": "test",
"body": "Hello Bob"
}
### 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