java-backend/rest.http

38 lines
No EOL
964 B
HTTP

### Get user by id (replace {{id}} or use a concrete id like 1)
GET http://175.15.15.91:8080/api/users/692cca264e957945b99f731a
Accept: application/json
# Authorization: Bearer {{token}}
### Find all users
GET http://175.15.15.91:8080/api/users
Accept: application/json
# Authorization: Bearer {{token}}
### Create a new user
POST http://175.15.15.91:8080/api/users
Content-Type: application/json
Accept: application/json
# Authorization: Bearer {{token}}
{
"name": "John Doe",
"email": "john.doe@example.com",
"password": "Pa$$w0rd",
"role": "user"
}
#### Update an existing user (replace {{id}} or use a concrete id like 1)
PUT http://175.15.15.91:8080/api/users/692cca264e957945b99f731a
Content-Type: application/json
Accept: application/json
# Authorization: Bearer {{token}}
{
"id": "692cca264e957945b99f731a",
"name": "Edvaldo",
"email": "edinho@gmail.com",
"password": "123456",
"profiles": [
"ROLE_CUSTOMER"
]
}