function TForm1.GetData(url:string): string; var responseText: WideString; xmlHttp: oleVariant; begin Result:=''; try xmlHttp:=CreateOleObject('Msxml2.XMLHTTP'); xmlHttp.open('POST',url,false); xmlHttp.send(); responseText:=xmlHttp.responseText; if xmlHttp.status='200' then begin Result:=responseText; end; xmlHttp := Unassigned; except Result:=''; end; end;
var
responseText: WideString;
xmlHttp: oleVariant;
begin
Result:='';
try
xmlHttp:=CreateOleObject('Msxml2.XMLHTTP');
xmlHttp.open('POST',url,false);
xmlHttp.send();
responseText:=xmlHttp.responseText;
if xmlHttp.status='200' then
begin
Result:=responseText;
end;
xmlHttp := Unassigned;
except
Result:='';
end;
end;