接口測試里如果報錯出現
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
或者
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x107ec2a20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
或者
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='XXXXX.com', port=443): Max retries exceeded with url: /proapi/user_device (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x107ec2a20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
或者
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='XXXXX.com', port=443): Max retries exceeded with url: /proapi/user_device (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x107ec2a20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
首先考慮本機網絡有問題,測試方法是把host直接復制到瀏覽器,看能不能打開網頁,如果不能打開,那就是網絡問題,如果可以打開,再查找其他問題
