Programming in Delphi
Top  Previous  Next

The HTTP Analyzer automation library is packaged as COM components. both Stand-alone and Add-on can be fully controlled from Delphi applications using OLE Automation.
To use the interface and dispinterface technologies in Delphi, we need to import HTTPAnalyzer-related type libraries.

1) Run Borland Delphi and go to Project menu. Then click Import Type Library... menu item to show Import Type Library dialog.
2) Import Type Library dialog will appear. Find the following COM libraries in the list of type libraries and click Install button.

There are three COM components related with HTTP Analyzer, namely,

HTTPAnalyzer Automation Common Library
The common library which defines most of the automation interfaces. Both Stand-alone and IE add-on editions need the library.
HTTPAnalyzer Stand-alone Automation Library
The stand-alone automation library includes the creatable object, IHTTPAnalyzerStandalone, which controls the HTTPAnalyzer Stand-alone out-proc COM server.
HTTPAnalyzer IE Add-on Library
The IE Add-on automation library includes the creatable object, IHTTPAnalyzerAddon, which controls the HTTPAnalyzer IE Add-on.


Access HTTPAnalyzer Stand-alone automation library
.
The IHTTPAnalyzerStandAlone object is used to control the HTTPAnalyzer Stand-alone. You can attach HTTPAnalyzerStandalone into a specific process or user/session/system wide.

var
  standalone:THTTPAnalyzerStandAlone;
  
entry:ILogEntry;
begin
  standalone := THTTPAnalyzerStandAlone.Create(nil);
  try
    standalone.Visible := true;
    standalone.AttachProcessByID(GetCurrenetProcessID);
    standalone.Start;
    ......
    standalone.Stop;

    for i :=0
  to standalone.Log.Count-1 do
    begin
      entry:=standalone.log[i];
      entry.Request;//get request

      entry.Response;//get response

      entry.Content;//get reqest content

  
      //do something

    end;
  finally
    standalone.free;
  end;
end;



Access HTTPAnalyzer IE Add-on automation library.
The IHTTPAnalyzerAddOn object is used to control the HTTPAnalyzer IE Add-on.

var
  addon:THTTPAnalyzerAddon;
  
entry:ILogEntry;
begin
  addon := THTTPAnalyzerAddon.Create(nil);
  try  
    addon.Start;
    ......
    addon.Stop;

    for i :=0  to addon.Log.Count-1
 do
    begin
      entry:=addon.log[i];
    
      entry.Request;//get request

      entry.Response;//get response

      entry.Content;//get reqest content.

      //do something

    end;
  finally
    addon.free;
  end;
end;