I am trying to get the contents of an HTTP document with MS XMLHTTP COM. I copied the following code sample, but even this does not work and does not execute with the EOLEException "Access denied" error when calling the send method.
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;
I really don't know what I'm doing wrong :(
source share