Skip to content

Instantly share code, notes, and snippets.

View gourie's full-sized avatar

Joeri Nicolaes gourie

View GitHub Profile
@gourie
gourie / jsonhandler.py
Created November 8, 2015 14:36 — forked from mminer/jsonhandler.py
A JSON request handler for Tornado.
import json
import tornado.web
class JsonHandler(BaseHandler):
"""Request handler where requests and responses speak JSON."""
def prepare(self):
# Incorporate request JSON into arguments dictionary.
if self.request.body:
try:
R_LIBS_USER="~/R"