在Delphi上使用Indy时如何忽略EIdConnClosedGracefully?

时间:2018-07-17 17:20:27

标签: delphi get indy digest-authentication idhttp

我正在使用Digest auth进行GET请求,但HTTP.Get除外。

HTTP := TIdHTTP.Create;
try
  HTTP.OnAuthorization := HTTPAuthorization;
  HTTP.Request.Clear;
  HTTP.HTTPOptions := HTTP.HTTPOptions + [hoInProcessAuth];

  Memo1.Text := HTTP.Get(LabeledEdit1.Text);
  ShowMessage('GOT!!!');
finally
  HTTP.Free;
end;

该异常是EIdConnClosedGracefully。

HTTP.Response.ResponseCode是401
HTTP.Response.ResponseText是“连接已正常关闭”。

即使有这种异常,我如何获得响应正文?

0 个答案:

没有答案