Skip to Content
1
Jul 05, 2023 at 09:03 AM

[SAP BYD - HELP] CSRF token validation failed

217 Views Last edit Jul 05, 2023 at 09:36 AM 3 rev

Hi Expert,

I have a problem below when I Patch to oData.

  • The first time, I Get oData with HeaderParam. It returns status 200.
  • Then I got HeaderParam "x-csrf-token" with the value which I GET it in the result and I Patch the Odata. It returns status 403 Forbidden.
  • I got an error "CSRF token validation failed" when I Patch It, I have tested it before in Postman it was successful.
  • I have tried many times like adding Cookies and changing the method Patch,... but it's not successful.

All my code I wrote in one script file, and I call GET, PATCH Odata at the same time.
P/s: So how can I fix it? I hope my question can be slove.
Thanks and Best Regards

1.png

2.png

3.png

4.png

Attachments

1.png (60.8 kB)
2.png (57.2 kB)
3.png (59.8 kB)
4.png (154.1 kB)