gpt4 book ai didi

python - App Engine "InvalidURLError: Invalid request URL"尽管 URL 在浏览器中运行正常

转载 作者:行者123 更新时间:2023-12-01 05:03:28 26 4
gpt4 key购买 nike

我正在使用 App Engine 任务队列来查询 AlchemyAPI 。我将文本字符串发送到任务队列。每个任务队列工作线程都会查询 AlchemyAPI 并处理结果。

在处理了大约 1500 个结果后,我开始收到无穷无尽的错误,如下所示:

InvalidURLError: Invalid request URL: http://access.alchemyapi.com/calls/text/TextGetRankedNamedEntities?outputMode=json&apikey=xxxx&text=myverylongtexthere

为什么我感到困惑的是,如果我直接将无效的 URL 复制/粘贴到浏览器中,它就可以正常工作!

什么可能导致这种错误?

最佳答案

由于 myverylongtexthere,我猜您的网址超过 2048 个字符。

google.appengine.api.urlfetch_errors.InvalidURLError
Raised when the URL given is empty or invalid.

Only http: and https: URLs are allowed. The maximum URL length
allowed is 2048 characters. The login/pass portion is not
allowed. In deployed applications, only ports 80 and 443 for http
and https respectively are allowed.

关于python - App Engine "InvalidURLError: Invalid request URL"尽管 URL 在浏览器中运行正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25532858/

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