Sto cercando di recuperare un contenuto del documento HTTP con MS XMLHTTP COM. Ho copiato il seguente codice di esempio, ma anche questo non funziona e non riesce con EOLEException errore 'Accesso negato' al metodo di invio chiamata.Errore XMLHTTP e "Accesso negato"
uses
MSXML, ComObj, ActiveX;
procedure TForm1.Button1Click(Sender: TObject);
var
httpDoc: XMLHTTP; // IXMLHTTPRequest
begin
httpDoc := CreateOleObject('MSXML2.XMLHTTP') as XMLHTTP;
try
httpDoc.open('GET', 'http://www.google.com/index.html', False, EmptyParam, EmptyParam);
httpDoc.send(''); // <-- EOLEException 'Access is denied'
if (httpDoc.readyState = 4) and (httpDoc.status = 200) then
ShowMessage(httpDoc.responseText);
finally
httpDoc := nil;
end;
end;
Io davvero non so cosa sto facendo di sbagliato :(
controlla anche se 'send' è davvero consentire vuota parametro stringa anziché canonico 'null' – OnTheFly