Exemple #1
0
    def handle_jsonp_rpc_request(self, request):
        request_data = request.GET['request']
        callback_name = request.GET['callback']
        # callback_name must be a simple identifier
        assert re.search(r'^\w+$', callback_name)

        result = self.execute_request(request_data)
        padded_result = '%s(%s)' % (callback_name, result)
        return rpc_utils.raw_http_response(padded_result,
                                           content_type='text/javascript')
Exemple #2
0
 def handle_rpc_request(self, request):
     json_request = self.raw_request_data(request)
     result = self.execute_request(json_request)
     return rpc_utils.raw_http_response(result)
Exemple #3
0
 def get_rpc_documentation(self):
     return rpc_utils.raw_http_response(self.html_doc)