# Response

All handlers must return a response object, and middleware may optionally return a response object.

# Methods

The easiest way to generate a response object is to use one of the nine (9) convenience methods.

    # Default status

    The default HTTP status code for the response is 200. If you need to change it, it can be done by the response method.

    @app.post("/")
    async def create_new(request):
        new_thing = await do_create(request)
        return json({"created": True, "id": new_thing.thing_id}, status=201)
    
    MIT Licensed | Copyright © 2018-present Sanic Community Organization