You can configure Indy to use a proxy script by installing ProxyParams easily:
try lHTTP.IOHandler := lIOHandler; lHTTP.ProxyParams.ProxyServer := '127.0.0.1'; lHTTP.ProxyParams.ProxyPort := 8888; sResponse := lHTTP.Post('<URL>', slRequest); Memo1.Lines.Text := sResponse; finally lIOHandler.Free; end;
Then you should see all the traffic in Fiddler.
Edit: if this does not work, you can add the TIdLogDebug component and add it as an interceptor (as in your question). The OnReceive and OnSend events contain complete headers sent and received, as well as response data:
procedure TForm10.captureTraffic(ASender: TIdConnectionIntercept; var ABuffer: TArray<Byte>); var i: Integer; s: String; begin s := ''; for i := Low(ABuffer) to High(ABuffer) do s := s + chr(ABuffer[i]); Memo1.Lines.Add(s); end;
source share