On the fphttpclient option i do not get error. But it is not sending data (i think) and does nothing. i have to stop it.
That is strange. I have no idea atm.
edit: in case you are running this compiled program on Windows, do you perhaps have antivirus/firewall running that blocks your lazarus application ?
In theory tfphttclient.SimpleGet should only 'hang' for the duration of timeout and return on errors (in which case the resulting body should be able to provide more information).
is it possible that i needed to specify the port number somewhere?
That is possible.I'm sorry but do not know much about arduino webserver. It should state somewhere what are the default options.
SimpleGet just sends data to the server at port 80. Perhaps arduino expects another port, such as 8080 ? Or perhaps the server only accepts secure connections ?
I saw that there are many fphttpclient versions. Is this one part of the same synapse package?
fphttpclient is part of fcl-web and is a native/default Free Pascal package.
In case your server is redirecting then simpleget will not work as you expected. In that case have a look at the link i posted in my previous post and use the 'full' version of retrieving a html page from your server. SimpleGet class method is only meant to work in/for the most simplest of conditions.
In case you wish to learn more about the data sending/retrieval between browser and server then you could consider using a proxy server. But there are also other options available that would let you inspect datapackets and/or http transfers.
edit2: I do not know much about synapse but i read:
Str:='http://1.0.4.1/arduino/webserver';
Copy-paste error or actual typo in your code (for the web-address) ?
edit3:
i tried both of your options: First, HTTPSend.GetText is giving me some error. i checked and it seems that there is no GetText method in the HTTPSend class.
Seems to me that user Almir.Bispo only got it partially correct. According
to this online help for synapse, it should read:
program synapsing;
Uses
HTTPSend;
var
url: String;
Response: TStringlist
begin
url := 'http://10.0.4.1/arduino/webserver';
Response := TStringList.Create;
if httpGetText (url , Response)
then ShowMessage(Reponse.text)
else ShowMessage('Failure');
Response.free;
end.