我试图运行此代码:
var
objHttp: TIdHTTP;
...
objHttp.HandleRedirects := True;
objHttp.AllowCookies := True;
sGet := objHttp.Get('http://www.bmf.com.br/arquivos1/arquivos_ipn.asp?idioma=pt-BR&status=ativo');
...
我得到了这个:
<code>
<html>
<head>
<title>Request Rejected</title>
</head>
<body>The requested URL was rejected. Please consult with your administrator.<br>Your support ID is: 109088803187671168</body>
</html>
</code>
任何想法为什么?
答案 0 :(得分:3)
解决方案,感谢TLama:
var
objHttp: TIdHTTP;
...
objHttp.HandleRedirects := True;
objHttp.AllowCookies := True;
objHttp.Request.UserAgent := 'Mozilla/5.0';
sGet := objHttp.Get('http://www.bmf.com.br/arquivos1/arquivos_ipn.asp?idioma=pt-BR&status=ativo');
...