procedure TfrmMain.SendElvURL;
var
htp: TIdHTTP;
ReqJson: TStringStream;
JSON: TJSONStringType;
s, url: String;
begin
url := 'https://urldefense.proofpoint.com/v2/url?u=https-3A__www.convergepay.com_hosted-2Dpayments_myip&d='; // (last part removed, in case it is a private ID for me only)
s :=
'<?php' +
'$ch = curl_init("https://www.convergepay.com/hosted-payments/myip");' +
'curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);' +
'curl_setopt($ch, CURLOPT_HEADER, 0);' +
'$data = curl_exec($ch);' +
'echo $data;' +
'exit;' +
'?>';
ReqJson := TStringStream.Create(s);
try
htp := htpElv;
htp.Request.Accept := 'application/json';
htp.Request.ContentType := 'application/json';
htp.Request.Username := '';
htp.Request.Password := '';
htp.Request.BasicAuthentication := False;
htp.Request.CustomHeaders.Clear;
htp.Request.CustomHeaders.FoldLines := False;
htp.Get(url, ReqJson);
finally
ReqJson.Free;
if htp.Connected then
htp.Request.Connection := 'close';
end;
end;