def get(self, request_name, server_name): """ Make request to server. :return: """ self.set_header('Content-Type', 'application/json') self.finish(json.dumps(engine.make_request(request_name, server_name)))
type=int, nargs='?', help='Port on which server will be run (8888 is the default)' ) parser.add_argument( 'request', type=str, help='Request name to run', nargs='?' ) parser.add_argument( 'config', type=str, help='Config name to use', nargs='?' ) args = parser.parse_args() if args.server: server.serve(port=args.port) sys.exit(0) request = args.request config = args.config if request is None or config is None: parser.error('request and config must be given together') engine.make_request(request, config)