further remove config
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 8cf6a35 · Browse files · 3 files·+2 added−28 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+2 added−28 removed
- other:+2 added−28 removed
Provenance
- Commit
4e5c4a6- Tree
5574432- Author
Kenneth Reitz <me@kennethreitz.com>- Committer
Kenneth Reitz <me@kennethreitz.com>- Parent
8cf6a35
3 files changed+2 added−28 removed
modified:requests/adapters.py-6 removed
162 unmodified lines163 if prefetch:164 r.content165 166 return r167-168-169-170-171-172-modified:requests/api.py+1 added-13 removed
28 unmodified lines29 :param timeout: (optional) Float describing the timeout of the request.30 :param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.31 :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.32 :param return_response: (optional) If False, an un-sent Request object will returned.33- :param session: (optional) A :class:`Session` object to be used for the request.34- :param config: (optional) A configuration dictionary. See ``request.defaults`` for allowed keys and their default values.33 :param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.34 :param prefetch: (optional) if ``True``, the response content will be immediately downloaded.35 :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.36 """37 40- # if this session was passed in, leave it open (and retain pooled connections);41- # if we're making it just for this call, then close it when we're done.42- adhoc_session = False43- session = kwargs.pop('session', None)44- if session is None:45- session = sessions.session(config=kwargs.get('config', None))46- adhoc_session = True47- # Todo, close sessions after?48-49-38+ session = sessions.Session()39 return session.request(method=method, url=url, **kwargs)40 41 42 def get(url, **kwargs):24 unmodified lines67 :param url: URL for the new :class:`Request` object.68 :param \*\*kwargs: Optional arguments that ``request`` takes.69 """70 82- kwargs.setdefault('allow_redirects', False)71 return request('head', url, **kwargs)72 73 74 def post(url, data=None, **kwargs):40 unmodified linesmodified:requests/sessions.py+1 added-9 removed
7 unmodified lines8 requests (cookies, auth, proxies).9 10 """11 12-from copy import deepcopy12 from .compat import cookielib13 from .cookies import cookiejar_from_dict, remove_cookie_by_name14 from .models import Request15 from .hooks import dispatch_hook16 from .utils import header_expand, from_key_val_list, default_headers18-from .packages.urllib3.poolmanager import PoolManager17 from .exceptions import TooManyRedirects18 19 from .compat import urlparse, urljoin20 from .adapters import HTTPAdapter110 unmodified lines131 """A Requests session."""132 133 __attrs__ = [134 'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks',137- 'params', 'config', 'verify', 'cert', 'prefetch']135+ 'params', 'verify', 'cert', 'prefetch']136 137 def __init__(self,138 headers=None,139 cookies=None,1 unmodified line141 timeout=None,142 proxies=None,143 hooks=None,144 params=None,147- config=None,145 prefetch=True,146 verify=True,147 cert=None):148 21 unmodified lines170 #: :class:`Request <Request>`. The dictionary values may be lists for171 #: representing multivalued query parameters.172 self.params = from_key_val_list(params or [])173 177- #: Dictionary of configuration parameters for this178- #: :class:`Session <Session>`.179- self.config = from_key_val_list(config or {})180-174 #: Prefetch response content.175 self.prefetch = prefetch176 177 #: SSL Verification.36 unmodified lines214 allow_redirects=True,215 proxies=None,216 hooks=None,217 return_response=True,225- config=None,218 prefetch=None,219 verify=None,220 cert=None):221 126 unmodified lines