further remove config

This commit is contained in:
Kenneth Reitz
2012-12-17 03:26:47 -05:00
parent 8cf6a3593d
commit 4e5c4a6ab7
3 changed files with 2 additions and 28 deletions
-6
View File
@@ -164,9 +164,3 @@ class HTTPAdapter(BaseAdapter):
r.content
return r
+1 -13
View File
@@ -30,23 +30,12 @@ def request(method, url, **kwargs):
:param allow_redirects: (optional) Boolean. Set to True if POST/PUT/DELETE redirect following is allowed.
:param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
:param return_response: (optional) If False, an un-sent Request object will returned.
:param session: (optional) A :class:`Session` object to be used for the request.
:param config: (optional) A configuration dictionary. See ``request.defaults`` for allowed keys and their default values.
:param verify: (optional) if ``True``, the SSL cert will be verified. A CA_BUNDLE path can also be provided.
:param prefetch: (optional) if ``True``, the response content will be immediately downloaded.
:param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
"""
# if this session was passed in, leave it open (and retain pooled connections);
# if we're making it just for this call, then close it when we're done.
adhoc_session = False
session = kwargs.pop('session', None)
if session is None:
session = sessions.session(config=kwargs.get('config', None))
adhoc_session = True
# Todo, close sessions after?
session = sessions.Session()
return session.request(method=method, url=url, **kwargs)
@@ -79,7 +68,6 @@ def head(url, **kwargs):
:param \*\*kwargs: Optional arguments that ``request`` takes.
"""
kwargs.setdefault('allow_redirects', False)
return request('head', url, **kwargs)
+1 -9
View File
@@ -9,13 +9,11 @@ requests (cookies, auth, proxies).
"""
from copy import deepcopy
from .compat import cookielib
from .cookies import cookiejar_from_dict, remove_cookie_by_name
from .models import Request
from .hooks import dispatch_hook
from .utils import header_expand, from_key_val_list, default_headers
from .packages.urllib3.poolmanager import PoolManager
from .exceptions import TooManyRedirects
from .compat import urlparse, urljoin
@@ -134,7 +132,7 @@ class Session(SessionMixin):
__attrs__ = [
'headers', 'cookies', 'auth', 'timeout', 'proxies', 'hooks',
'params', 'config', 'verify', 'cert', 'prefetch']
'params', 'verify', 'cert', 'prefetch']
def __init__(self,
headers=None,
@@ -144,7 +142,6 @@ class Session(SessionMixin):
proxies=None,
hooks=None,
params=None,
config=None,
prefetch=True,
verify=True,
cert=None):
@@ -174,10 +171,6 @@ class Session(SessionMixin):
#: representing multivalued query parameters.
self.params = from_key_val_list(params or [])
#: Dictionary of configuration parameters for this
#: :class:`Session <Session>`.
self.config = from_key_val_list(config or {})
#: Prefetch response content.
self.prefetch = prefetch
@@ -222,7 +215,6 @@ class Session(SessionMixin):
proxies=None,
hooks=None,
return_response=True,
config=None,
prefetch=None,
verify=None,
cert=None):