Error Messages:
raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: (‘Connection aborted.’, BadStatusLine(“””, ))
Codes
data = {"host":host,"key":key,"value":value,"dns":ip}
res = requests.post(url=url,json = data)
Method 1: add retry
requests.adapters.DEFAULT_RETRIES = 5
Method 2: add header
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0'}
res = requests.post(url=url,json = data,headers=headers)
Method 3: curl
If method 1,2 does not work, use curl command to find the following error messages:
Empty reply from server
Solution: https://stackoverflow.com/questions/48814200/connection-aborted-badstatusline-on-server
Read More:
- Python requests Error: ConnectionError: (‘Connection aborted.‘, error(104, ‘Connection reset by peer‘))
- Python + Requests +Excel+Jenkins interface automation
- Failed to establish a new connection: [winerror 10048] in the requests thread pool, the interface is called circularly to get the datagram error
- Python Requests Error: Max retries exceeded with url
- visdom Install and Run Error: raise Connectionerror [How to Solve]
- [Solved] Python Requests Error: simplejson.errors.JSONDecodeError: Expecting value
- Python Error: Failed to establish a new connection: [Errno -2] Name or service not known
- [Solved] socketio.exceptions.ConnectionError: OPEN packet not returned by server
- When sending HTTP request, python encountered: error 54, ‘connection reset by peer’ solution
- [Solved] Forbidden (403) CSRF verification failed. Request aborted.
- ModuleNotFoundError: No module named ‘requests‘ [How to Solve]
- [Solved] ModuleNotFoundError: No module named ‘requests‘
- [Solved] Pychar error: modulenotfounderror: no module named ‘requests_ HTML ‘solution
- Linux create connection command ln -s soft connection
- [Solved] NPM install Error: check python checking for Python executable python2 in the PATH
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- [Solved] opencv-python: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all‘ failed
- How to Fix “HTTP error 403: forbidden” in Python 3. X
- Python Error: pip install mysql-connector-python failed