I need to call a php script on my server, which will return some database value.
How do i call the php?
TWebHTTPRequest seems not to work and return always an error, for example, when I call:
So there is no HTTP library to do a simple GET to an URL, just like I can do in Delphi with Indy or other?
ANY address I use with webhttprequest will fail for me.
To make it more clear:
I have a text file "test.txt" on my server. How can I read it with web core?
I have given 3 links that explain the phenomenon you see.
TWebHttpRequest is the component with which to do HTTP requests.
Web applications run in a web browser and a web browser is a secure sandbox environment that implements its own security techniques and part of that is CORS. So, if you want to use a HTTP GET request to get a TXT file, you either need to do this from the domain where your web application is running from or enable CORS on the server on another domain where the TXT file is hosted.
Please read the information in the 3 links I sent in the previous reply.
That is fine for me but it is not a proper or correct solution.
It implicates that any user of this web application would need to install this extension.
The one and only correct solution is to enable CORS or on the server or to host the web client application on the same domain as the REST server.