OnHeadersAvailable on TIdCustomHTTP doesn't work (RLebeau)

Giganews Newsgroups
Subject: OnHeadersAvailable on TIdCustomHTTP doesn't work (RLebeau)
Posted by:  Ralph Maas (ralphma…@hotmail.com)
Date: Mon, 16 May 2005

Hi,

when issuing a normal SSL (get) request, the OnHeadersAvailable ebent on
TIdCustomHTTP is not called. I tried this:

procedure TIdCustomHTTP.InitComponent;
begin
  inherited;
  FURI := TIdURI.Create('');

  FAuthRetries := 0;
  FAuthProxyRetries := 0;
  AllowCookies := true;
  FFreeOnDestroy := false;
  FOptions := [hoForceEncodeParams];

  FRedirectMax := Id_TIdHTTP_RedirectMax;
  FHandleRedirects := Id_TIdHTTP_HandleRedirects;
  //
  FProtocolVersion := Id_TIdHTTP_ProtocolVersion;

  FHTTPProto := TIdHTTPProtocol.Create(Self);
  FHTTPProto.OnHeadersAvailable := DoOnHeadersAvailable; // <====  ADDED BY
RM
  FProxyParameters := TIdProxyConnectionInfo.Create;
  FProxyParameters.Clear;

  FMaxAuthRetries := Id_TIdHTTP_MaxAuthRetries;
  FMaxHeaderLines := Id_TIdHTTP_MaxHeaderLines;
end;

And that does the trick.

Regards,

Ralph.

Replies