Need help with Synapse in Android lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- stab · 2013-10-02 18:42 Hi, Trying to use code-example from http://wiki.freepascal.org/Synapse procedure TfrmMain.btnSearchClick(Sender: TObject); var   HTTPGetResult: Boolean;   HTTPSender: THTTPSend;   URL, TargetFile : string; begin   HTTPSender := THTTPSend.Create;   try     URL := 'http://api.geonames.org/search?q=london&maxRows=10&username=demo';     HTTPGetResult := HTTPSender.HTTPMethod('POST', URL);     Label1.Caption := 'HTTPSender.ResultCode: ' + IntToStr(HTTPSender.ResultCode);     if (HTTPSender.ResultCode >= 100)and        (HTTPSender.ResultCode <= 299) then     begin       HTTPSender.Document.SaveToFile(TargetFile);       Label1.Caption := Label1.Caption + lineEnding + TargetFile;     end;   finally     HTTPSender.Free;   end; but I get HTTPSender.ResultCode: 500 Internal Server Error and same result using either  GET or POST. If I try the URL in Crome or IE it works OK. Isn't it possible to use synapse in this way within Android? Regards stab ---------------------------------------------------------------------- BigChimp · 2013-10-03 07:19 500 internal server error indicates a problem at the server end (assuming all error handling is implemented correctly in the code you're using). Perhaps the site filters based on user agent string or something like that? Does the same code run on a desktop? ---------------------------------------------------------------------- stab · 2013-10-03 09:30 Yes, the code runs OK on desktop. Have been trying in different ways and noticed that if I specify explicit IP-address then I can get resultcode:200. Tried even to get hold of ip-address to api.geonames.org through ping but that didn't even work in browser on desktop. Seems to have something to be with DNS-resolving. It also works in browser in android-phone.