How to disable csrf for a view with flask-wft for a restapi?

FlaskForm.validate() seems to be the one returning that error, i.e. try

form = myForm(request.form, csrf_enabled=False)

or

class myForm(FlaskForm):
    class Meta:
        csrf = False

     username = StringField("user name")

since csrf_enabled seems to be deprecated.

From the documentation

Any view using FlaskForm to process the request is already getting CSRF protection.


You can pass meta={'csrf': False} as parameter in your constructor

form = myForm(request.form, meta={'csrf': False})