Topic Path: Symbol Reference > Classes > TIdHTTPProtocol Class > TIdHTTPProtocol Methods > ProcessResponse Method
TIdHTTPProtocol.ProcessResponse Method

Handles the state-dependent processing of requests and responses for an HTTP client.

function ProcessResponse(
    AIgnoreReplies: array of SmallInt
): TIdHTTPWhatsNext;

TIdHTTPWhatsNext - Next step to perform for the protocol handler.

ProcessResponse is a TIdHTTPWhatsNext function that allows the HTTP protocol handler to perform state-dependent protocol exchanges using the Request and Response properties. ProcessResponse is, in essence, the state machine used to control actions of a TIdHTTP client during connection and request/response processing. 

ProcessResponse allows the protocol handler to detect and respond to various conditions that include: 

  • Header processing.
  • Redirection in a HTTP response.
  • Use of Keep-Alive for Secure Socket Layer transport.
  • HTTP Server and Proxy Server authorization.
  • Response content stream handling.
  • Exception processing.

ProcessResponse is used when the HTTP client attempts to connect to the remote server to perform an HTTP request or receive an HTTP response. The TIdHTTPWhatsNext return value for ProcessResponse is updated often during execution of the method based on the numeric HTTP result codes. 

Use OnHeadersAvailable to determine if response processing can be continued on the client based on header values found in the HTTP response. 

ProcessResponse detects and handles redirection responses (when HandleRedirects contains True in the HTTP client), as well as incrementing the value in the RedirectCount property. 

When the HTTP response indicates that Authentication is required for the Server or Proxy Server, ProcessResponse triggers the OnAuthorization and OnProxyAuthorization event handlers when HTTPOptions contains the value hoInProcessAuth. 

ProcessResponse also implements a work-around for buggy HTTP 1.1 servers which do not return a response body for a 302 response code. It uses a 4 second timout when reading the content for the HTTP response. The value in the ReadTimeout property for the IOHandler is unaffected by this operation.

Raised when a protocol response code indicates an error has occurred. 
Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.