Skip to content
Myr

add prefetch to main request distpatch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent dfbfb23 · Browse files · 1 file+12 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−6 removed

  • other:+12 added−6 removed

1 file+12 added−6 removed

modified:requests/models.py+12 added-6 removed
302 unmodified lines
303 else:304 return self.url305306307 def send(self, anyway=False):307 def send(self, anyway=False, prefetch=False):308 """Sends the request. Returns True of successful, false if not.309 If there was an HTTPError during transmission,310 self.response.status_code will contain the HTTPError code.311
51 unmodified lines
363364 # Update self to reflect the auth changes.365 self.__dict__.update(r.__dict__)366367 # Check to see if keep_alive is allowed.368 if self.config.get('keep_alive'):369 conn = self._poolmanager.connection_from_url(url)367 _p = urlparse(url)368 proxy = self.proxies.get(_p.scheme)369370 if proxy:371 conn = connectionpool.proxy_from_url()372 else:373 # Check to see if keep_alive is allowed.374 if self.config.get('keep_alive'):375 conn = self._poolmanager.connection_from_url(url)376 else:371 conn = connectionpool.connection_from_url(url)377 conn = connectionpool.connection_from_url(url)378379 if not self.sent or anyway:380381 if self.cookies:
20 unmodified lines
402 body=body,403 headers=self.headers,404 redirect=False,405 assert_same_host=False,400 preload_content=False,406 preload_content=prefetch,407 decode_content=False,408 retries=self.config.get('max_retries', 0)409 )410
162 unmodified lines