0
votes
Vote UpVote

Indy: getting response despite exceptions or 4xx HTTP status codes

The Wiert Corner – Formy snippet archive (thanks Walter Prins for answering and Oliver Funcke for asking and elaborating on the answer): in the case of error, you can get what would’ve normally been in the contentstream from the ExceptionObj.ErrorMessage property.  So you can use something like the following if you want to get the content response regardless of http response code (untested): var FResponseStream: TStringStream; FRequestURL, Content : String; begin //.... etc etc try FIdHTTP.Get(FRequestURL, FResponseStream); Content := FResponseStream.DataString; except on ...
Favorite? Off-Topic? jpluimers @ 2016-12-07 06:05

Statistics

Visits: 1641
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)