From c70228e7b62482261641a653dffead4be9b193eb Mon Sep 17 00:00:00 2001 From: Stanislaw Klekot Date: Thu, 19 Jun 2014 18:06:05 +0200 Subject: [PATCH] Allowed POST for /api/v1/person/. --- API.txt | 3 ++- wlokalu/api/v1/views.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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":