title: Python requests module Error - cant load any url: 'Remote end closed connection without response'
body: <p>I am trying to fetch data from an url using python 3.5 using the following code</p>
  
  <pre><code>import requests
  url ='http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi'
  r = requests.get(url)
  r.content
  </code></pre>
  
  <p>The url can be opened with no problems in the browser.</p>
  
  <p>However, I am getting an error (for this URL and any other URL I try) as follows:</p>
  
  <pre><code>-------------------------------------------------------------------------- 
  TypeError                                 Traceback (most recent call last)
  C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
       375             try:  # Python 2.7, use buffering of HTTP responses
   --&gt; 376                 httplib_response = conn.getresponse(buffering=True)
       377             except TypeError:  # Python 2.6 and older
  
   TypeError: getresponse() got an unexpected keyword argument 'buffering'
  
   During handling of the above exception, another exception occurred:
  
   RemoteDisconnected                        Traceback (most recent call last)
   C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py
   in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
       558                                                  timeout=timeout_obj,
   --&gt; 559                                                   body=body, headers=headers)
       560 
  
   C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py
   in _make_request(self, conn, method, url, timeout,
   **httplib_request_kw)
       377             except TypeError:  # Python 2.6 and older
   --&gt; 378                 httplib_response = conn.getresponse()
       379         except (SocketTimeout, BaseSSLError, SocketError) as e:
  
   C:\Anaconda3\lib\http\client.py in getresponse(self)    1173          
   try:
   -&gt; 1174                 response.begin()    1175             except ConnectionError:
  
   C:\Anaconda3\lib\http\client.py in begin(self)
       281         while True:
   --&gt; 282             version, status, reason = self._read_status()
       283             if status != CONTINUE:
  &gt; 
  &gt; C:\Anaconda3\lib\http\client.py in _read_status(self)
  &gt;     250             # sending a valid response.
  &gt; --&gt; 251             raise RemoteDisconnected("Remote end closed connection without"
  &gt;     252                                      " response")
  &gt; 
  &gt; RemoteDisconnected: Remote end closed connection without response
  &gt; 
  &gt; During handling of the above exception, another exception occurred:
  &gt; 
  &gt; ProtocolError                             Traceback (most recent call
  &gt; last) C:\Anaconda3\lib\site-packages\requests\adapters.py in
  &gt; send(self, request, stream, timeout, verify, cert, proxies)
  &gt;     369                     retries=self.max_retries,
  &gt; --&gt; 370                     timeout=timeout
  &gt;     371                 )
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py
  &gt; in urlopen(self, method, url, body, headers, retries, redirect,
  &gt; assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
  &gt;     608             retries = retries.increment(method, url, error=e, _pool=self,
  &gt; --&gt; 609                                         _stacktrace=sys.exc_info()[2])
  &gt;     610             retries.sleep()
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\packages\urllib3\util\retry.py
  &gt; in increment(self, method, url, response, error, _pool, _stacktrace)
  &gt;     244             if read is False:
  &gt; --&gt; 245                 raise six.reraise(type(error), error, _stacktrace)
  &gt;     246             elif read is not None:
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\packages\urllib3\packages\six.py
  &gt; in reraise(tp, value, tb)
  &gt;     308         if value.__traceback__ is not tb:
  &gt; --&gt; 309             raise value.with_traceback(tb)
  &gt;     310         raise value
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py
  &gt; in urlopen(self, method, url, body, headers, retries, redirect,
  &gt; assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
  &gt;     558                                                   timeout=timeout_obj,
  &gt; --&gt; 559                                                   body=body, headers=headers)
  &gt;     560 
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py
  &gt; in _make_request(self, conn, method, url, timeout,
  &gt; **httplib_request_kw)
  &gt;     377             except TypeError:  # Python 2.6 and older
  &gt; --&gt; 378                 httplib_response = conn.getresponse()
  &gt;     379         except (SocketTimeout, BaseSSLError, SocketError) as e:
  &gt; 
  &gt; C:\Anaconda3\lib\http\client.py in getresponse(self)    1173          
  &gt; try:
  &gt; -&gt; 1174                 response.begin()    1175             except ConnectionError:
  &gt; 
  &gt; C:\Anaconda3\lib\http\client.py in begin(self)
  &gt;     281         while True:
  &gt; --&gt; 282             version, status, reason = self._read_status()
  &gt;     283             if status != CONTINUE:
  &gt; 
  &gt; C:\Anaconda3\lib\http\client.py in _read_status(self)
  &gt;     250             # sending a valid response.
  &gt; --&gt; 251             raise RemoteDisconnected("Remote end closed connection without"
  &gt;     252                                      " response")
  &gt; 
  &gt; ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end
  &gt; closed connection without response',))
  &gt; 
  &gt; During handling of the above exception, another exception occurred:
  &gt; 
  &gt; ConnectionError                           Traceback (most recent call
  &gt; last) &lt;ipython-input-16-598f53da7af3&gt; in &lt;module&gt;()
  &gt;       3 import requests
  &gt;       4 url ='http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi'
  &gt; ----&gt; 5 r = requests.get(url)
  &gt;       6 r.content
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\api.py in get(url, params,
  &gt; **kwargs)
  &gt;      67 
  &gt;      68     kwargs.setdefault('allow_redirects', True)
  &gt; ---&gt; 69     return request('get', url, params=params, **kwargs)
  &gt;      70 
  &gt;      71 
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\api.py in request(method, url,
  &gt; **kwargs)
  &gt;      48 
  &gt;      49     session = sessions.Session()
  &gt; ---&gt; 50     response = session.request(method=method, url=url, **kwargs)
  &gt;      51     # By explicitly closing the session, we avoid leaving sockets open which
  &gt;      52     # can trigger a ResourceWarning in some cases, and look like a memory leak
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\sessions.py in request(self,
  &gt; method, url, params, data, headers, cookies, files, auth, timeout,
  &gt; allow_redirects, proxies, hooks, stream, verify, cert, json)
  &gt;     466         }
  &gt;     467         send_kwargs.update(settings)
  &gt; --&gt; 468         resp = self.send(prep, **send_kwargs)
  &gt;     469 
  &gt;     470         return resp
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\sessions.py in send(self,
  &gt; request, **kwargs)
  &gt;     574 
  &gt;     575         # Send the request
  &gt; --&gt; 576         r = adapter.send(request, **kwargs)
  &gt;     577 
  &gt;     578         # Total elapsed time of the request (approximately)
  &gt; 
  &gt; C:\Anaconda3\lib\site-packages\requests\adapters.py in send(self,
  &gt; request, stream, timeout, verify, cert, proxies)
  &gt;     410 
  &gt;     411         except (ProtocolError, socket.error) as err:
  &gt; --&gt; 412             raise ConnectionError(err, request=request)
  &gt;     413 
  &gt;     414         except MaxRetryError as e:
  &gt; 
  &gt; ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote
  &gt; end closed connection without response',))
  </code></pre>