您的位置:首页 > 理论基础 > 计算机网络

TIdHTTP.Get EIdIOHandlerPropInvalid Error

2016-10-22 17:24 309 查看
down voteaccepted
To avoid this exception you must assign the IOHandler property.

Check this sample.
{$APPTYPE CONSOLE}

{$R *.res}

uses
IdHTTP,
IdSSLOpenSSL,
SysUtils;

Var
IdHTTP1 : TIdHTTP;
Src : string;
LHandler: TIdSSLIOHandlerSocketOpenSSL;
begin
try
IdHTTP1:=TIdHTTP.Create(nil);
try
LHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
try
IdHTTP1.IOHandler:=LHandler;
Src:= IdHTTP1.Get('https://tools.usps.com/go/ZipLookupResultsAction!input.action?resultMode=0&companyName=&address1=1600+PENNSYLVANIA+AVE+NW&address2=&city=&state=Select&urbanCode=&postalCode=&zip=20500');
Writeln(Src);
finally
LHandler.Free;
end;
finally
IdHTTP1.Free;
end;
except on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
Readln;
end.


Note : Also remember copy the SSL DLL (libeay32.dll, ssleay32.dll) to your system.

down voteaccepted
To avoid this exception you must assign the IOHandler property.

13down
voteaccepted
To avoid this exception you must assign the IOHandler property.

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  idhttp
相关文章推荐