gpt4 book ai didi

delphi - idHttp Get + Delphi + 请求的URL被拒绝

转载 作者:行者123 更新时间:2023-12-02 00:55:28 58 4
gpt4 key购买 nike

我正在尝试运行此代码:

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>

知道为什么吗?

最佳答案

解决方案,感谢 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');
...

关于delphi - idHttp Get + Delphi + 请求的URL被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27172043/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com