9 lines
490 B
Bash
9 lines
490 B
Bash
TOKEN=$(curl -s -X POST http://localhost:8080/api/auth/login \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"username":"test","password":"cGFzc3dvcmQ="}' | sed -n 's/.*"token":"\([^"]*\)".*/\1/p')
|
|
|
|
curl -X POST http://localhost:8080/api/workers/register \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"name": "Test","surname": "Test","dni": "12345678A","dateOfBirth": "1990-05-15","email": "jari.sciampi@mailbox.org","category":"FISIO"}'
|