Creating a view function without returning a response in Flask Creating a view function without returning a response in Flask flask flask

Creating a view function without returning a response in Flask


It's quite simple, just return an empty string with 204 status code:

@app.route('/')def hello():    # ...    return '', 204