问题
I have created a rest api in Symfony. It uses form for the client to send the data. I have used 'csrf_protection' => false in setDefaultOptions, but still getting the error
The CSRF token is invalid. Please try to resubmit the form
回答1:
Did you test your api over NelmioApiDocBundle sanbox, or your sending data from form on frontned side? Are you sure that your not sending csrf_protection requsest parameter to your api?
来源:https://stackoverflow.com/questions/19344272/csrf-token-is-invalid-when-calling-rest-post-api-from-php-client