0

我正在使用烧瓶。我不知道如何为我的服务器可能收到的任何 OPTIONS 请求添加“Accept-Patch”响应。

会是这样吗(我试过这个,虽然它有效,但我不确定这是否允许):

class MyViewMixin(MethodView):
    def options(self, id):
        response = make_response('This works!', 200)
        response.headers.extend({'Accept-Patch': '*'})
        return response

    def get(self, id): #same for post, delete, put, patch
        #stuff here#

感谢您的帮助。

4

0 回答 0