Delphi6 and XE3.
I want to get the real response body of a request. But the server makes error 500. Then the Indy replace the response text with the description of the error.
This homepage is designed for answer 500 in non abnormal operations too, and we need to determine what to do from response text.
Could I get the response text from IdHTTP or from an Exception object when the status code is 500?
Thanks for any info!
When
TIdHTTP
encounters a server error, it raises anEIdHTTPProtocolException
exception, where itsErrorCode
property contains the HTTP status code (500, etc), itsMessage
property contains the HTTP status text ("Internal Error", etc), and itsErrorMessage
property contains the body text of the response, if any. So, for example: