Permalink
Browse files

Fixed JSON no parameters issue and added a 'noargs' method to the tes…

…t handler.

git-svn-id: http://tornadorpc.googlecode.com/svn/trunk@9 6a0cc88c-bc38-11de-9a73-11f8458f6c97
  • Loading branch information...
1 parent 3da9f51 commit 170098a8626a35069def97bd2d7b76fea5219c4a catchjosh committed Sep 13, 2010
Showing with 8 additions and 3 deletions.
  1. +3 −0 tornadorpc/base.py
  2. +5 −3 tornadorpc/json.py
View
@@ -352,6 +352,9 @@ def add(self, x, y):
def ping(self, x):
return x
+
+ def noargs(self):
+ return 'Works!'
tree = TestMethodTree()
View
@@ -62,11 +62,13 @@ def parse_request(self, request_body):
if isbatch(request):
self._batch = True
for req in request:
- req_tuple = (req['method'], req['params'])
+ req_tuple = (req['method'], req.get('params', []))
request_list.append(req_tuple)
else:
- self._requests = [request,]
- request_list.append((request['method'], request['params']))
+ self._requests = [request,]
+ request_list.append(
+ (request['method'], request.get('params', []))
+ )
return tuple(request_list)
def parse_responses(self, responses):

0 comments on commit 170098a

Please sign in to comment.