谁能给我解析一下idhttp的几个属性和它的事件及方法,特别是当post成功后将触发的那个事件?

解决方案 »

  1.   

    建议你还是去看 TIdHttp 的在线帮助,那是最全的啦。因为 Indy 的 Client 端基本都是采用阻塞式的方式工作的,所以,一般的事件功能用途不到。Post 也不例外,Post 所有的结果走作为属性、返回值返回了,基本不需要事件帮助。
    编程上会用到的倒是这些事件,不过一般是高级应用才用的:
    OnAuthorization
    OnSelectAuthorization
    OnProxyAuthorization
    OnSelectProxyAuthorization
      

  2.   

    "TIdHttp 的在线帮助"在哪里找?我google了一下没找到,你能给我网址吗?
      

  3.   

    Delphi 自己带有的啊!我觉已经已经比较详细的了,如果觉得还不够,可以在下载 Indy 的官方 Demo 看看。你用的是 Delphi 7 吗?那个 Indy 9.0 比较好用。
    http://www.indyproject.org/    ---- Indy 的官方网站
      

  4.   

    我看了help里的内容,他只解析了 OnRedirect一个事件;Indy 的官方网站,我也都看了,但没找到有用的信息!
      

  5.   

    你用的什么版本的啊?我上面说的都有很详细的解释的,Indy 的官方网站有各种版本的帮助文件,我想你是没有找到。还有很好的 Demo 程序。还有一本书加《Indy In Depth》,不记得哪里有得下了,你自己搜索一下。帮助例子:
    ---------------------------
    TIdHTTP.OnAuthorization
    TIdHTTP
    Event handler for authentication of an HTTP connection.
    property OnAuthorization: TIdOnAuthorization;
    Parameters
    Handled
    Indicatesd if the authentication was successful.
    Sender
    HTTP Client generating the event notification.
    VPassword
    User authorization for the HTTP request.
    VUserName
    User identity for the HTTP request.
    Description
    OnAuthorization is a published TIdOnAuthorization property in TIdHTTP, and represents the event handler signalled when an HTTP client connection needs to provide authentication data as part of an HTTP request.
    VUserName and VPassword are the authentication credentials found in the HTTP Request, and can be updated in the event handler. Handled indicates if the event handler has successfully authenticated using the client account credentials and method.
    --------------------------------------------------------------------------------TIdHTTP.OnProxyAuthorization
    TIdHTTP
    Event handler for selecting the HTTP client authentication mechanism for a proxy connection.
    property OnProxyAuthorization: TIdOnAuthorization;
    Parameters
    AuthenticationClass
    Authentication class to use for the connection.
    AuthInfo
    Header values to use in authectication.
    Sender
    HTTP client generating the event notification.
    Description
    OnProxyAuthorization is a published TIdProxyOnAuthorization property in TIdHTTP, and represents the event handler signalled when an HTTP client selects an authentication class to be used when session or proxy authentication is required for a connection. OnProxyAuthorization is signalled prior to triggering the OnAuthorization event handler.
    AuthenticationClass is the class instance to be used to perform authentication for the mechanisms required in an HTTP request.AuthInfo is the header values to be be used in the HTTP response that includes the authentication results.
      

  6.   

    我用的是Delphi 6,不清楚indy是什么版本的,!《Indy In Depth》要30欧元,太贵了!
    很感谢你帮我,谢谢!
      

  7.   

    我有 《Indy In Depth》电子版,要的话发邮件到 [email protected]