Hello SAPUI5 people,
I'm still having some issues with posting to the SAP backend.
The Problem:
I am using jQuery to post to the SAP backend via the following code:
I added a debugger to the incoming webservice call in SAP and it says Method: OPTIONS instead of Method: POST.
I have tested this from my local webserver & via the sap cloud portal.
The big But
When I simply run that code via an HTML file in Internet Explorer, and look at the debugger it says Method: POST and adds my data the my table.
My local code: http://pastie.org/5477806
Now the big But, when I run the same file in Firefox / Chrome, the Method turns to OPTIONS again.
What needs to happen (don't know how)
SAP needs to enable cross-origin resource sharing on the online webserver.
Or someone needs to suggest me a better way of doing this.
Temp Fix (bad practice)
I can replace the Method Options to Method Post, hard coded. But this is dirty nasty code.
Temp conclusion
Works:
Does not Work:
More information about CORS:
I hope someone can help me, because I spend a lot of time figuring this out.
Kind regards,
Vincent
Request clarification before answering.
Hi Vincent,
Check the following link.
HTML5 ROCKS - Using CORS
http://www.html5rocks.com/en/tutorials/cors/?redirect_from_locale=en
Preflight Request:
The preflight request is made as an HTTP OPTIONS request (so be sure your server is able to respond to this method)
Hope it helps.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.