Which FPC or Lazarus unit contains xmlhttprequest object? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- vfclists · 2012-04-01 18:01 I want to run a  Delphi program which uses msmxl for IXMLHTTPRequest and I need the Lazarus unit which implements the same. Which unit contains it? I can see XMLHTTPRequest on this forum but I can't find it when I search the sources. /vfclistsGUY ---------------------------------------------------------------------- ludob · 2012-04-02 09:13 msxml is a com object. You can import the msxml.tlb type library with importtl.exe which is available in fpc 2.6.1 or 2.7.1 (both from svn repository). The import will result in a unit that contains all interface and coclass declarations for the com object, including IXMLHTTPRequest.  I guess your Delphi program does the same and uses a unit called msxml_tlb or something similar. The alternative is to use it with "late binding": Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var XMLHTTPReq:OleVariant; begin   XMLHTTPReq:=CreateOleObject('MSXML2.XMLHTTP.6.0');   XMLHTTPReq.open('GET', 'http://192.168.2.105/array.xml', false);   XMLHTTPReq.send();   Memo1.Lines.Add(XMLHTTPReq.responseText); end; ---------------------------------------------------------------------- vfclists · 2012-04-02 23:36 When I look at the code it seems to serve a role that can be performed by other web related libraries and it needs to be cross platform. Is there something in fpweb that might perform this role? Quote from: ludob on April 02, 2012, 11:13:49 ammsxml is a com object. You can import the msxml.tlb type library with importtl.exe which is available in fpc 2.6.1 or 2.7.1 (both from svn repository). The import will result in a unit that contains all interface and coclass declarations for the com object, including IXMLHTTPRequest.  I guess your Delphi program does the same and uses a unit called msxml_tlb or something similar. The alternative is to use it with "late binding": Code: [Select]procedure TForm1.Button1Click(Sender: TObject); var XMLHTTPReq:OleVariant; begin   XMLHTTPReq:=CreateOleObject('MSXML2.XMLHTTP.6.0');   XMLHTTPReq.open('GET', 'http://192.168.2.105/array.xml', false);   XMLHTTPReq.send();   Memo1.Lines.Add(XMLHTTPReq.responseText); end; ---------------------------------------------------------------------- ludob · 2012-04-03 07:47 Quoteand it needs to be cross platformPffff.... That is the sound of my crystal ball failing again QuoteI want to run a  Delphi program which uses msmxl for IXMLHTTPRequestSo much for asking the right question. ---------------------------------------------------------------------- Laksen · 2012-04-03 08:32 Just use httpsend from Synapse. It's very easy to use and crossplatform ---------------------------------------------------------------------- DavidTh30 · 2017-09-01 01:43 To use "xmlhttprequest" depends on where you use. "Microsoft.XMLHTTP" and "MSXML2.XMLHTTP.3.0" need permission or login before send something to URL. I use "WinHttp.WinHttpRequest.5.1" only request to getting the message. I show you.  uses   ...   Variants, comobj, RegExpr;  Function getText(strURL: variant): String;  //My testing device is "FL BT EPA" and "FL BT EPA MP" (communicate using AT language) var   xstrResult:variant;   WinHttpReq:variant;   temp:variant; begin   WinHttpReq:=CreateOleObject('Microsoft.XMLHTTP');   temp:=WinHttpReq.Open('GET',strURL,false);   try   WinHttpReq.Send();   xstrResult:= WinHttpReq.responseText;   except     showmessage('Transfer not work');     //raise;     Exit;   end;   getText:=xstrResult; end; Function getText3(strURL: variant): String;  //My testing device is "FL BT EPA" and "FL BT EPA MP" (communicate using AT language) var   XMLHTTPReq:variant; begin   XMLHTTPReq:=CreateOleObject('MSXML2.XMLHTTP.3.0');   try   XMLHTTPReq.Open('GET',strURL,false);   except     showmessage('access denied');     Exit;   end;   try   XMLHTTPReq.Send();   getText3:= XMLHTTPReq.responseText;   except     showmessage('Transfer not work');     Exit;   end; end; Function getText2(strURL: variant): String; var   http :variant; begin   http:=createoleobject('WinHttp.WinHttpRequest.5.1');   try   http.open('GET', strURL, false);   http.send;   except     showmessage('Transfer not work');     Exit;   end;   getText2:=http.responsetext; end; procedure TForm1.Button1Click(Sender: TObject); var   re: TRegExpr;   strAns:String; begin   re := TRegExpr.Create;   re.Expression := '.*OK.*';   strAns:=getText('http://10.0.0.100/form?at=at*amli=admin');   if re.Exec(strAns) then showmessage('OK') else showmessage('not OK'); end; procedure TForm1.Button2Click(Sender: TObject); var   strAns:String; begin   strAns:=getText2('http://lazarus.freepascal.org');   Showmessage(strAns); end; procedure TForm1.Button3Click(Sender: TObject); var   strAns:String; begin   strAns:=getText3('http://10.0.0.100/form?at=at*amli=admin');   Showmessage(strAns); end;