如何在THTTPRIO中设置反馈?

Raf*_*cci 3 delphi web-services delphi-2010

我开发了一个Webservice,我在Delphi上使用它.

Indy组件有一个OnWork事件,但我在THTTPRIO中找不到类似的东西.

是否有OnWork活动THTTPRIO?我猜它在内部使用了Indy,但我确信这一点.

jfo*_*ira 6

您可以访问THTTPRIO.HTTPWebNode对象的事件.

例:

procedure TYourClass.SomePostingDataEvent(Sent: Integer; Total: Integer);
begin
  //Do something
end;

procedure TYourClass.SomeReceivingDataEvent(Read: Integer; Total: Integer);
begin
  //Do something
end;

procedure TYourClass.SomeMethod;
begin
  YourHTTPRIO.HTTPWebNode.OnPostingData := SomePostingDataEvent;
  YourHTTPRIO.HTTPWebNode.OnReceivingData := SomeReceivingDataEvent;
end;
Run Code Online (Sandbox Code Playgroud)

希望这对你有所帮助!