idHttp Get + Delphi + The requested URL was rejected

1.5k views Asked by At

I'm trying to run this code:

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');
...

and I'm getting this:

<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>

any idea why?

1

There are 1 answers

0
GPGomes On BEST ANSWER

Solution, thanks to 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');
  ...