on 02-13-2015 9:16 PM
Hello experts,
I was able to follow Marvin Hoffman’s excellent tutorial in 3 parts. Also, many posts from Jitendra Kansal were very helpful in this task. I’m using SMP 3.0, installed in a local server. The database is HSQLDB. I was also able to create a hybrid app using SAPUI5 with PhoneGap for iOS, where via Javascript I connect to SMP and read the database.
Here is a Postman print screen with a successfull GET method, that also works via Javascript in the app.
I have an issue with the POST method. I always get a 403 (Forbidden) response. As pointed out in the posts, I collected the cookies in the GET operation and send in the POST.
I’m not sure if there is an issue with the formation of the POST, or if there’s a configuration missing on SMP.
Thanks in advance for your help,
Luciano Sclovsky
Tags edited by: Jitendra Kansal (Moderator)
Hi Luciano,
403 forbidden HTTP status code happens when the server refuses to take action for the request. A reason could be that you are not passing the X-CSRF-TOKEN with the header.
Make a GET request first, it should get the X-CSRF-TOKEN in the response. Pass this value for the POST operation in the header.
Regards, Midhun
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Before making any POST/PUT/delete request you have to get the value of the X-CSRF-TOKEN in GET request.As Midhun already pointed out, i dont see any header called "X-CSRF-TOKEN" getting passed in GET request.
Which SMP 3.0 SP you are working on? Is it SP03 or S04 or SP05? Dont you need to pass any payload in POST request? I can see that you are trying with OData service which has been exposed via Integration gateway, can you tell us what is the backend for that service? Is it not SOAP WS?
Regards,
JK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jitendra,
Sorry for the delay, since I was off last week. Thank you for your answers. I'm using SMP 3.0.3 SP03.
I'll proceed with the investigation with the feedback you, Midhun and Bjoern sent. I will send my update later today, along with the answers to your other questions.
Best regards,
Luciano
Jitendra,
I found this other post from yours that was very helpful. I followed it to fix my issue. Thanks!
I attached an image of the solution above, answering Midhun.
Regarding the OData service, I had already done it before just like you did it in your post.
Regards,
Luciano
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.