Search code examples
delphiindyidhttp

idHttp Get + Delphi + The requested URL was rejected


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?


Solution

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