我在中编写了一些函数,如下所示服务器.py文件。你知道吗
import requests
@app.route('/similarwords')
def test():
url = 'http://127.0.0.1:8000/api/searchActivity'
response = requests.get(url)
print response
在运行服务器时,我向“similarwords”端点发出请求。在请求。获取(url)服务器被阻止。 同时向其他URL发送请求示例“www.google.com“发球正确。你知道吗
在python控制台上,它执行得很好。你知道吗
>> import requests
>> requests.get("http://127.0.0.1:8000/api/searchActivity")
>> Response[200]
有什么问题。我正在localhost中执行我的项目。你知道吗
您没有提到“阻塞”是仅在本地设置中发生,还是在生产中发生。我想它只是本地的。你知道吗
结果是
我以前也遇到过这个问题,并发现了它here。 本文还建议在本地使用
gunicorn
之类的解决方法来克服“限制”,并警告说,在heroku自由层类型设置中,问题可能会再次出现。你知道吗相关问题 更多 >
编程相关推荐