diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e46a9a7 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +## Methods +- GET `/` + - Response + - 200 Ok + - HTML `"This is a POKO server"` +- GET `/user/<id>` + - Response + - 200 Ok + - JSON `{"name": "NAME", "id": "ID"}` + - 404 Not Found + - JSON `"Not Found"` +- GET `/user/by_name/<name>` + - Response + - 200 Ok + - JSON `[{"name": "NAME", "id": "ID"}, ...]` + - 400 Not Found + - JSON `"Not Found"` +- GET `/user/all` + - Same as GET `/user/by_name/` +- POST `/user/register` + - Request + - JSON `{"name":"NAME", "password": "PASSWORD", "id": "ID"}` + - ID is optional + - Response + - 201 Created + - 400 Bad Request + - JSON `"UID is taken"` + - 500 Internal Server Error + - JSON `"No available UID left"` + - JSON `"UID length is incorrect"` + - JSON `"UID String is not valid"` +- POST `/user` + - Request + - JSON `{"id": "ID", "password": "PASSWORD", "clientid": "CLIENT_ID"}` + - Response + - 200 Ok + - JSON `"SESSION_KEY"` + - The session key is needed for any authenticated action + - 401 Unauthorized + - JSON `"Could not login"` +- POST `/user/logout` + - Request + - JSON `{"id": "ID", "session": "SESSION_KEY"}` + - Response + - 200 Ok + - 401 Unauthorized + - JSON `"Not Authenticated"`
\ No newline at end of file |