From: Kenneth Reitz Date: Sun, 18 Sep 2011 05:43:04 +0000 (-0400) Subject: cleanups X-Git-Tag: v0.8.0~94^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18270e1059c8eaea2bced14caad2d35e78fe7e8a;p=services%2Fpython-requests.git cleanups --- diff --git a/requests/models.py b/requests/models.py index 43e141b..653ae05 100644 --- a/requests/models.py +++ b/requests/models.py @@ -311,23 +311,37 @@ class Request(object): url = self._build_url() # Setup Files. + if self.files: + pass + # Setup form data. - # - # def urlopen(self, method, url, body=None, headers=None, retries=3, - # redirect=True, assert_same_host=True): - # req = _Request(url, data=self._enc_data, method=self.method) + elif self.data: + pass + + # Setup cookies. + elif self.cookies: + pass + + # req = _Request(url, data=self._enc_data, method=self.method) + # Only send the Request if new or forced. if (anyway) or (not self.sent): try: + + # Create a new HTTP connection, since one wasn't passed in. if not connection: connection = urllib3.connection_from_url(url, timeout=self.timeout) + + # One-off request. Delay fetching the content until needed. do_block = False else: + # Part of a connection pool, so no streaming. Sorry! do_block = True + # Create the connection. r = connection.urlopen( method=self.method, url=url, @@ -338,9 +352,6 @@ class Request(object): block=do_block ) - # r.socket = pool._get_conn().sock - # r.fo = r.data - # if self.cookiejar is not None: # self.cookiejar.extract_cookies(resp, req)