Hi. I installed synapse (as lpk), put ssleay32.dll and libeay32.dll (from here
https://indy.fulgan.com/SSL/) in the project folder, and added httpsend and openssl to the uses clause, yet my simple test (from wiki) always fails with error 500 when using a https url (http works just fine).
Now, I am new to http requests, so I don't know if that is related to SSL or my request.
function DownloadHTTP(URL, TargetFile: string): Boolean;
var
HTTPGetResult: Boolean;
HTTPSender: THTTPSend;
begin
Result := False;
HTTPSender := THTTPSend.Create;
try
HTTPGetResult := HTTPSender.HTTPMethod('GET', URL);
showMessage(inttostr(HTTPSender.ResultCode));
if (HTTPSender.ResultCode >= 100) and (HTTPSender.ResultCode<=299) then begin
HTTPSender.Document.SaveToFile(TargetFile);
Result := True;
end;
finally
HTTPSender.Free;
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
DownloadHTTP('https://www.phoronix.com/phxcms7-css/phoronix.png','E:\phoronix.png');
end;
What am I missing? (Laz 2.0.6, fpc 3.0.4)