def handle(self, d): try: args = self._convert_to_arg_list(d) rslt = self._call_func(args) body = self._translate_result_body(rslt) ctx = Context.curctx() return Response(resps.STATUS_200, body, ctx.response_headers, ctx.response_cookies) except Response, r: return r
def call_internal_api(api, **fields): ctx = Context.curctx() key = generate_auth_key(ctx.publisher_id, ctx.manager_id, ctx.role) headers = { 'INTERNAL-AUTHORIZATION' : key } return call_api(api, headers, **fields)
def handle(self, d): Context.curctx().header('Content-Type', 'application/json; charset=utf-8') for k in d: d[k] = json2.loads(d[k]) return super(json_handler, self).handle(d)
def call_internal_api(api, **fields): ctx = Context.curctx() key = generate_auth_key(ctx.publisher_id, ctx.manager_id, ctx.role) headers = {'INTERNAL-AUTHORIZATION': key} return call_api(api, headers, **fields)