def index(request): return Ok({"echo-response": request.body["echo"]}, headers={"Content-Type": "application/json"})
def detail(request, index): if len(database) > index: return Ok(database[index], mimetype="application/json") else: return NotFound()
def list(request): return Ok(database, mimetype="application/json")
def index(request): return Ok(request.new_data)
def hello(request): return Ok("Hello World!")
def index(request): return Ok("Index")
def index(request): return Ok("Hello World!")
def index(request): value = request.session.get('value', 0) request.session['value'] = value + 1 return Ok(request.session, headers={"Content-Type": "application/json"})