diff --git a/API.txt b/API.txt index 4393c70..a1bf542 100644 --- a/API.txt +++ b/API.txt @@ -1,7 +1,8 @@ PUT http://wlokalu.hswro.org/api/v1/person/ DELETE http://wlokalu.hswro.org/api/v1/person/ - Person entered or left premises. + Person entered or left premises. PUT can be also replaced with POST + (just for convenience, as normally POST should carry some content). POST http://wlokalu.hswro.org/api/v1/sensor/ diff --git a/wlokalu/api/v1/views.py b/wlokalu/api/v1/views.py index dc24c47..70da3da 100644 --- a/wlokalu/api/v1/views.py +++ b/wlokalu/api/v1/views.py @@ -16,7 +16,7 @@ def person(request, nick): 'uri': request.META['REQUEST_URI'], } - if request.method == "PUT": + if request.method == "PUT" or request.method == "POST": presence.person_entered(nick, context) reply = {"status": "ok"} elif request.method == "DELETE":