I have a webservice written in Net Weaver gateway. I need to POST a data for which first I have to fetch an x-csrf-token. I am getting that token by a GET method. Upto there my code is working fine. But when I have to send the data using POST with the fetched x-csrf-token I am getting InvalidOperation exception or 403 bad request.

I want to remind you that the webservice is working fine in the RestClient of firefox, so there is no issue with webservice request. Also I want to pass the token as a header field in the POST call. So fetching token is a must. Token is dynamically generated and cannot be hardcoded.

I can share code if anyone needs to see it. Code is for WINDOWS mobile 6.5

有帮助吗?

解决方案

I got the solution.Added header Cookie and its working fine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top