cancel
Showing results for 
Search instead for 
Did you mean: 

Creat entity async using proxy classes

kkumari_konda86
Discoverer
0 Kudos

Hi All,

i am developing one android application using odata proxy classes with sap cloud SDK i would like to use createEntityAsync method for create entity. How should i get response as json object?. How to use that method for create entity can you please suggest anyone how to do that?.

provider.createEntityAsync(entity, () -> {<br>   <br>}, (RuntimeException re) -> {<br>    <br>},httpHeaders);

I used like above for post request but first time i got exception status code 403 forbidden but second time i sent same request with same headers i got success can you please help me what's wrong with this.

Accepted Solutions (0)

Answers (1)

Answers (1)

evanireland
Advisor
Advisor
0 Kudos

I suggest enabling tracing at the HTTP layer (check OkHttp tracing options from SDK, or check with your server team) to find out why status 403 is returned the first time - perhaps the server wants a CSRF-Token?

The solution here won't be to get response of POST as JSON a object (the provider already does this and parses it when response status is 201) - the solution will be to determine cause of 403 through tracing and fix/avoid it.