TWebRadServerClientDataset does not work

I just downloaded a demo of TMS Web Core and tried the demo loacated in "TMS WEB Core RSXE14\Demos\DBBackend\RadServer" It does not seem to work as all the request are using the options verb and RAD server does not support that. The login process must be done as a post. See this line from my log files when clicking the login button in the demo:
"OPTIONS /ems-server/users/login HTTP/1.1" 200 -

What RAD server version do you use?
Is this the latest version?

I'm using the latest version of RAD Server, Delphi and TMS Web Core. I have done some more research and I'm able to reproduce the problem with a TWebClientConnection. The problems seems to be with non-standard headers. If I add "Connection=keep-alive" to WebClientConnection1.Headers, everything works as expected (a post request is sent to the server). But if I add "X-Embarcadero-App-Secret=DFKEDsdf234#", only an OPTIONS request is sent to the server and not the post request.

Now I'm wonder if it is TMS WEB Core or the web browser (I have tried width Edge and Chrome) that is causing the options request beeing sent rather than the actual request? My Rad Server is running under apache on Linux. The server returns an empty message with status code 200 to the options request. Would TMS Web Core follow up with the actual post request if the response from the server included some specific data? For example "Access-Control-Allow-Headers: X-Embarcadero-App-Secret"

I found this interesting article about the issue giving me problems:
Why is my browser sending an OPTIONS HTTP request instead of POST? - DEV Community

I solved my problem. I'm new to web programming and did not know about the Dev tools that are present in the browser. Looking at the console in dev tools, I saw what the problem was:
http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I solved the problem by adding this line to my apache config file:
Header set Access-Control-Allow-Origin "*"

The preflight message was triggered by the browser because of the custom headers for Rad server and it had nothing to do with TMS Web Core. Sorry for bothering you.

Thanks for informing.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.