0

I am using Flask. I'm lost as to how to add an "Accept-Patch" response to any OPTIONS requests my server might get.

Would it be something like this (I tried this and while it worked, I'm not sure if this is allowed):

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#

Thank you for the assistance.

user2986242
  • 477
  • 1
  • 5
  • 19

0 Answers0