예제 #1
0
 def handler(request):
     r = HTTPResponse('application/json; charset=UTF-8', 'UTF-8')
     r.write_bytes(b)
     r.status_code = status_code
     return r
예제 #2
0
 def json_response(self, obj):
     r = HTTPResponse('application/json; charset=UTF-8', 'UTF-8')
     r.write_bytes(ujson.dumps(obj))
     return r
예제 #3
0
 def status_response(self):
     assert not self.errors
     response = HTTPResponse('application/json; charset=UTF-8', 'UTF-8')
     response.write_bytes('{"status":"OK"}')
     return response