我正在使用Flask。我很遗憾如何为我的服务器可能获得的任何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#
感谢您的帮助。