I am doing an Android application that consumes OData from SAP Gateway in java. In this moment, I am able to retrieve data from the gateway, but when I want to update or create something, an error occurs saying "Expected Status OK or No Content".... I was reading in Internet and I would need to retrieve CSRF token in GET and set it on post and put operations.... How can I do this in android app consuming OData from SAP Gateway and using OData4j? My code for create the consumer is this:
ODataConsumer consumer = ODataConsumers.create(serviceUrl);
ODataConsumer.Builder builder = ODataConsumers.newBuilder(serviceUrl);
builder.setClientBehaviors(new BasicAuthenticationBehavior("myuser", "mypass"));
consumer = builder.build();
Like you can see, i have the basic Authentication but it miss the csrf token...
I hope you can help me.
Thanks so much,
Borja.