首页 > 解决方案 > 当我尝试发出 http 请求时,它显示为连接错误,而之前它没有显示为连接错误

问题描述

import json
import requests

country = 'GB'
url = ('http://kitkabackend.eastus.cloudapp.azure.com:5010/highscore/crowns/list?country='+country)  
r = requests.get(url)
print(r.text)

相同的代码之前为我工作了一段时间,但现在它突然给我一个像以前一样的错误。我尝试在请求时添加标头,但这也没有解决错误。(我是使用 repl.it 的初学者)

控制台上显示错误 - raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response

标签: pythonpython-requestshttpurlconnectionpython-requests-htmlpython-requests-json

解决方案


推荐阅读