text/html
特定のケースでは、次のようにエラーのコンテンツ タイプで応答したいと思います。
class MyResource(Resource):
def get(self):
if some_condition:
return 'bad argument', 400
上記のコードはapplication/json
content-type:'"bad argument"'
の代わりにcontent-type: を返しますtext/html
。'bad argument'
text/html
コンテンツタイプでフラスコレストフルに応答させるにはどうすればよいですか?