def view(request: Request): return response(request).json( { "object": CustomObject(), }, default=_default, )
def view(request: Request): return response(request).json( { "object": CustomObject(), }, encoder_class=_JsonEncoder, )
def view(request: Request): return response(request, 201).json({"user": { "details": { "name": "root" } }}, indent=4)
def view(request: Request): return response(request).html("<b>html text</b>")
def view(request: Request): return response(request).send_file(pathlib.Path(file_path), file_name="file.bin", inline=True)
def view(request: Request): return response(request).back()
def view(request: Request): return response(request).back({"user": "******"})
def view(request: Request): return response(request).text("plain text response")
def view(request: Request): return response(request).template(template_path, {"username": "******"})
def view(request: Request): return response(request).stream(numbers(), media_type="text/plain", file_name="numbers.txt", inline=True)
def view(request: Request): return response(request).stream(numbers())
def view(request: Request): return response(request).send_file(file_path, file_name="file.bin")
def view(request: Request): return response(request).redirect("profile")
def view(request: Request): return response(request).redirect("/about")
def view(request: Request): return response(request, 201).json({"user": "******"})