Welcome
Here are the API's provided by this server
Description |
Gets the user info, matching the name. |
URL |
/api/getUserInfo/<name> |
HTTP Method |
GET |
Format |
Plain Text |
Example of GET request |
/api/getUserInfo/Ingrid |
Returns status 200 for OK, 400 for bad request and 500 for server error; plus the user info
OR a message indicating what went wrong. |
{ "name": "Ingrid", "age": 30, "city": "Paris" }
{ "Error": "failed to connect to server on first connect" }
|
Description |
Adds or updates a user, matching the name. |
URL |
/api/addOrUpdateUser |
HTTP Method |
POST |
Format |
JSON |
Example of POST payload |
{ "name": "Jon", "age": 40, "city": "London" } |
Returns status 200 for OK, 400 for bad payload and 500 for server error; plus a message indicating
what happened |
{ "result": "User added successfully" }
{ "result": "User updated successfully" }
|
Description |
Deletes the user, matching the name. |
URL |
/api/deleteUser/<name> |
HTTP Method |
DELETE |
Format |
Plain Text |
Example of DELETE request |
/api/deleteUser/Ingrid |
Returns status 200 for OK, 400 for bad request or if the user was already gone and 500 for
server error; plus a message indicating what happened. |
{ "result": "User deleted successfully" }
{ "result": "User was already gone" }
|