suchen

Heim  >  Fragen und Antworten  >  Hauptteil

python requests 访问接口 报错 [Errno -2] Name or service not known

1.有几个公开的api接口,我是通过requests 访问的频率比较大,因为需要监控状态。而且还是多进程。就会报这个错误


Vm operation - HTTPConnectionPool(host='*', port=80): Max retries exceeded with url: /gic/v1/task_status/?task_id= (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7f5e7fb2f410>: Failed to establish a new connection: [Errno -2] Name or service not known',))


查了一些,说在头部信息中加入关闭连接。等等 一有没有好的解决方法!

迷茫迷茫2787 Tage vor1507

Antworte allen(0)Ich werde antworten

Keine Antwort
  • StornierenAntwort