Delphi/C++Builder Indy IdHttp のエラーメッセージ取得
IdHttp でレスポンスコード 500 等での応答内容を取得
try
ResponseStr := Http.Get(URL);
except
on E: EIdHTTPProtocolException do begin
ACode := E.ErrorCode; // エラーコード
AMessage := E.Message; // HTTP/1.1 500 Internal Server Error 等
AErrorMessage := E.ErrorMessage; // メッセージ(ブラウザでは画面に表示される)
end;
end;
コメント