SAP Connector create results in Error CSRF Token.

2
Hi, I want to use the SAP ODataConnector for my app. For the get list function, I get a response. But, when I want to create an object and send it to SAP I get the following error: sapodataconnector.utils.ODataResponseException CREATE|Response code: 403, Response text: CSRF token validation failed I understand I have to create a header with the CSRF token and put that in the Request Parameters, but after I tried that in multiple ways, I still get this error. Would be great if someone could help me with this :)  Thanks!
asked
2 answers
5

Hi Jacob, this is correct the create action requires a CSRF token.

Before doing the create action you can obtain a list of CSRF tokens from your session object.

Retrieve the list over association and use the list operation Head to obtain the last one. If no token exists, call the get list operation and check again afterwards.

answered
0

Hey, this is very old but anyone can help with the headers of the get list? what did you put I am trying to put the bearer token with name = “Authorization” but I get a 401 error

answered