(self, conn, method, url, timeout=_Default,
                      **httplib_request_kw)
return httplib_response
Perform a request on a given urllib connection object taken from our
        pool.

        :param conn:
            a connection from one of our connection pools

        :param timeout:
            Socket timeout in seconds for the request. This can be a
            float or integer, which will set the same timeout value for
            the socket connect and the socket read, or an instance of
            :class:`urllib3.util.Timeout`, which gives you more fine-grained
            control over your timeouts.
Perform a request on a given urllib connection object taken from our
        pool.
Perform a request on a given urllib connection object taken from our pool .
def _make_request(self, conn, method, url, timeout=_Default,
                      **httplib_request_kw):
        """
        Perform a request on a given urllib connection object taken from our
        pool.

        :param conn:
            a connection from one of our connection pools

        :param timeout:
            Socket timeout in seconds for the request. This can be a
            float or integer, which will set the same timeout value for
            the socket connect and the socket read, or an instance of
            :class:`urllib3.util.Timeout`, which gives you more fine-grained
            control over your timeouts.
        """
        self.num_requests += 1

        timeout_obj = self._get_timeout(timeout)
        timeout_obj.start_connect()
        conn.timeout = timeout_obj.connect_timeout

        # Trigger any extra validation we need to do.
        try:
            self._validate_conn(conn)
        except (SocketTimeout, BaseSSLError) as e:
            # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout.
            self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
            raise

        # conn.request() calls httplib.*.request, not the method in
        # urllib3.request. It also calls makefile (recv) on the socket.
        conn.request(method, url, **httplib_request_kw)

        # Reset the timeout for the recv() on the socket
        read_timeout = timeout_obj.read_timeout

        # App Engine doesn't have a sock attr
        if getattr(conn, 'sock', None):
            # In Python 3 socket.py will catch EAGAIN and return None when you
            # try and read into the file pointer created by http.client, which
            # instead raises a BadStatusLine exception. Instead of catching
            # the exception and assuming all BadStatusLine exceptions are read
            # timeouts, check for a zero timeout before making the request.
            if read_timeout == 0:
                raise ReadTimeoutError(
                    self, url, "Read timed out. (read timeout=%s)" % read_timeout)
            if read_timeout is Timeout.DEFAULT_TIMEOUT:
                conn.sock.settimeout(socket.getdefaulttimeout())
            else:  # None or a value
                conn.sock.settimeout(read_timeout)

        # Receive the response from the server
        try:
            try:  # Python 2.7, use buffering of HTTP responses
                httplib_response = conn.getresponse(buffering=True)
            except TypeError:  # Python 2.6 and older
                httplib_response = conn.getresponse()
        except (SocketTimeout, BaseSSLError, SocketError) as e:
            self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
            raise

        # AppEngine doesn't have a version attr.
        http_version = getattr(conn, '_http_vsn_str', 'HTTP/?')
        log.debug("\"%s %s %s\" %s %s" % (method, url, http_version,
                                          httplib_response.status,
                                          httplib_response.length))

        try:
            assert_header_parsing(httplib_response.msg)
        except HeaderParsingError as hpe:  # Platform-specific: Python 3
            log.warning(
                'Failed to parse headers (url=%s): %s',
                self._absolute_url(url), hpe, exc_info=True)

        return httplib_response
def _make_request ( self , conn , method , url , timeout = _Default , * * httplib_request_kw ) : self . num_requests += 1 timeout_obj = self . _get_timeout ( timeout ) timeout_obj . start_connect ( ) conn . timeout = timeout_obj . connect_timeout # Trigger any extra validation we need to do. try : self . _validate_conn ( conn ) except ( SocketTimeout , BaseSSLError ) as e : # Py2 raises this as a BaseSSLError, Py3 raises it as socket timeout. self . _raise_timeout ( err = e , url = url , timeout_value = conn . timeout ) raise # conn.request() calls httplib.*.request, not the method in # urllib3.request. It also calls makefile (recv) on the socket. conn . request ( method , url , * * httplib_request_kw ) # Reset the timeout for the recv() on the socket read_timeout = timeout_obj . read_timeout # App Engine doesn't have a sock attr if getattr ( conn , 'sock' , None ) : # In Python 3 socket.py will catch EAGAIN and return None when you # try and read into the file pointer created by http.client, which # instead raises a BadStatusLine exception. Instead of catching # the exception and assuming all BadStatusLine exceptions are read # timeouts, check for a zero timeout before making the request. if read_timeout == 0 : raise ReadTimeoutError ( self , url , "Read timed out. (read timeout=%s)" % read_timeout ) if read_timeout is Timeout . DEFAULT_TIMEOUT : conn . sock . settimeout ( socket . getdefaulttimeout ( ) ) else : # None or a value conn . sock . settimeout ( read_timeout ) # Receive the response from the server try : try : # Python 2.7, use buffering of HTTP responses httplib_response = conn . getresponse ( buffering = True ) except TypeError : # Python 2.6 and older httplib_response = conn . getresponse ( ) except ( SocketTimeout , BaseSSLError , SocketError ) as e : self . _raise_timeout ( err = e , url = url , timeout_value = read_timeout ) raise # AppEngine doesn't have a version attr. http_version = getattr ( conn , '_http_vsn_str' , 'HTTP/?' ) log . debug ( "\"%s %s %s\" %s %s" % ( method , url , http_version , httplib_response . status , httplib_response . length ) ) try : assert_header_parsing ( httplib_response . msg ) except HeaderParsingError as hpe : # Platform-specific: Python 3 log . warning ( 'Failed to parse headers (url=%s): %s' , self . _absolute_url ( url ) , hpe , exc_info = True ) return httplib_response