Python Flask Intentional Empty Response

前端 未结 1 1034
深忆病人
深忆病人 2020-11-28 08:39

Is there a way to return a response (from make_response() object or similar) with certain properties so that it doesn\'t render the page again and doesn\'t do a

1条回答
  •  广开言路
    2020-11-28 08:49

    You are responding to a request, your HTTP server must return something. The HTTP 'empty response' response is 204 No Content:

    return ('', 204)
    

    Note that returning a file to the browser is not an empty response, just different from a HTML response.

    0 讨论(0)
提交回复
热议问题