chg: [api] default content-type is set to JSON
parent
d9897caf61
commit
ce71307801
|
@ -8,6 +8,11 @@ import json
|
||||||
|
|
||||||
class Query(tornado.web.RequestHandler):
|
class Query(tornado.web.RequestHandler):
|
||||||
|
|
||||||
|
def prepare(self):
|
||||||
|
header = "Content-Type"
|
||||||
|
body = "application/json"
|
||||||
|
self.set_header(header, body)
|
||||||
|
|
||||||
def post(self):
|
def post(self):
|
||||||
query = json_decode(self.request.body)
|
query = json_decode(self.request.body)
|
||||||
if 'uuid' in query:
|
if 'uuid' in query:
|
||||||
|
@ -26,6 +31,11 @@ class Query(tornado.web.RequestHandler):
|
||||||
|
|
||||||
class Get(tornado.web.RequestHandler):
|
class Get(tornado.web.RequestHandler):
|
||||||
|
|
||||||
|
def prepare(self):
|
||||||
|
header = "Content-Type"
|
||||||
|
body = "application/json"
|
||||||
|
self.set_header(header, body)
|
||||||
|
|
||||||
def get(self, uuid):
|
def get(self, uuid):
|
||||||
if uuid in tai_full:
|
if uuid in tai_full:
|
||||||
result = tai_full[uuid]
|
result = tai_full[uuid]
|
||||||
|
|
Loading…
Reference in New Issue