Answer the question
In order to leave comments, you need to log in
Why do I get an error when I type r = requests.get(f'{BASE_URL}getMe')?
Traceback (most recent call last):
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 603, in urlopen
chunked=chunked)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "C:\Users\Mikha \AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 843, in _validate_conn
conn.connect()
File "C:\Users\Mikha\AppData\Local\Programs\Python \Python37\lib\site-packages\urllib3\connection.py", line 370, in connect
ssl_context=context)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl_.py", line 355, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 412, in wrap_socket
session=session
File "C:\Users\Mikha\AppData\Local\Programs\Python \Python37\lib\ssl.py", line 853, in _create
self.do_handshake()
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] The remote host forcibly terminated an existing connection
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py" , line 449, in send
timeout=timeout
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 641, in urlopen
_stacktrace=sys. exc_info()[2])
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 368, in increment
raise six.reraise (type(error), error, _stacktrace)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 603, in urlopen
chunked=chunked)
File " C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 344, in _make_request
self._validate_conn(conn)
File "C:\Users\Mikha\ AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 843, in _validate_conn
conn.connect()
File "C:\Users\Mikha\AppData\Local\Programs\Python\ Python37\lib\site-packages\urllib3\connection.py", line 370, in connect
ssl_context=context)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl_.py", line 355, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 412, in wrap_socket
session=session
File "C:\Users\Mikha\AppData\Local\Programs\Python \Python37\lib\ssl.py", line 853, in _create
self.do_handshake()
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'Remote host forcibly aborted existing connection', None, 10054, None))
During handling of the above exception, another exception occurred:
Traceback (most recent call last ):
File "", line 1, in
r = requests.get(f'{BASE_URL}gerMe')
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\requests \api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site -packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File " C:\Users\Mikha\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'Remote host forcibly aborted an existing connection', None, 10054, None))
Maybe it's a VPN problem but I don't know what to do
Answer the question
In order to leave comments, you need to log in
Given that BASE_URL is usually set without a slash at the end, you have f'{BASE_URL}getMe' here, perhaps the wrong url is formed (without a slash before getMe). Try this f'{BASE_URL}/getMe'
Yes, it's a vpn issue. Throws an error that the connection to the Internet has been disconnected
ConnectionResetError: [WinError 10054] The remote host forcibly terminated the existing connection
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question