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