def render(self): self.headers['Content-Type'] = 'application/json' self.headers['P3P'] = 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"' body = json.dumps(self.body) response = render(body, self.status_code, self.status_msg, self.headers) return response
def index(application, message): name = message.get_argument('name', 'dude') context = { 'name': name, } body = application.render_template('success.html', **context) return render(body, 200, 'OK', {})
def test(application, message): u_index = app.url_for('index') u_handle_int = app.url_for('handle_int', a=23) d_handle_int = app.url_for('handle_int', method='POST') u_test_endpoint = app.url_for('test_endpoint', external=True) return render("url_for output: index: %s, handle_int: %s, default_param: %s, test_endpoint: %s" %(u_index, u_handle_int, d_handle_int, u_test_endpoint), 200, 'OK', {})
def test(application, message): u_index = app.url_for('index') u_handle_int = app.url_for('handle_int', a=23) d_handle_int = app.url_for('handle_int', method='POST') u_test_endpoint = app.url_for('test_endpoint', external=True) return render( "url_for output: index: %s, handle_int: %s, default_param: %s, test_endpoint: %s" % (u_index, u_handle_int, d_handle_int, u_test_endpoint), 200, 'OK', {})
def new_name_handler(application, message, name): return render('Take five, %s!' % (name), 200, 'OK', {})
def foo(application, message): name = message.get_argument('name', 'dude') body = 'Take five, %s!' % name return render(body, 200, 'OK', {})
def test(application, message): return render("Test Endpoint", 200, 'OK', {})
def handle_int(application, message, a): return render("You passed int value:%s" % str(a), 200, 'OK', {})
def one(application, message): body = 'Take five one' return render(body, 200, 'OK', {})
def check_int(application, message, value): return render(body_success, 200, 'OK', {})
def process(application, message, ids): return render(body_success, 200, 'OK', {})
def one(application, message): return render(body_success, 200, 'OK', {})
def check_float(application, message, value): return render("You passed float value:%s" % str(value), 200, 'OK', {})
def index(application, message): body = 'Take five index' return render(body, 200, 'OK', {})
def SlowFunction4(application, message): logging.debug("Slow Function 4 starting %s." % message.conn_id) gevent.sleep(5) logging.debug("Slow Function 4 done.") return render("Slow function 4...", 200, 'OK', {})
def process(application, message, ids): body = 'Take five - %s' % (str(ids)) return render(body, 200, 'OK', {})
def index(application, message): return render("index", 200, 'OK', {})
def check_int(application, message, value): return render("You passed int:%s" % str(value), 200, 'OK', {})