on 03-22-2014 12:53 PM
Hi,
I am creating a WCF rest service to consume SAP OData service in my application i am able to read data but not able to insert entity.
I am getting an issue while add X-CSRF-Token to Entity Request Header. Please help me on this.
I wrote unit test for debug my POST implementation. When i am debugging the code , when ever "((HttpWebRequest)e.Request).Headers.Add("X-CSRF-Token", csrfToken)" code executing , i am getting exception that "csrf token validation failed".
Need a help on this Urgent?
Thanks,
Siva
You need to fetch the CSRF token and pass it with every Insert/Update/Delete call. To get the CSRF token , you need to pass header 'X-CSRF-Token' with value 'Fetch'. You will get the CSRF token in response . For CUD calls you need to pass this with 'X-CSRF-Token'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.