Flask-RESTful - Return custom Response format

前端 未结 3 385
南旧
南旧 2021-02-01 06:23

I have defined a custom Response format as per the Flask-RESTful documentation as follow.

app = Flask(__name__)
api = restful.Api(app)

@api.representation(\'app         


        
3条回答
  •  温柔的废话
    2021-02-01 06:51

    Just return Flask response objects in your methods.

    A response class allows you to provide custom headers (including the content-type): http://flask.pocoo.org/docs/api/#response-objects

提交回复
热议问题