mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
from cookies import extract_cookies_to_jar
This commit is contained in:
@@ -20,6 +20,7 @@ from .packages.urllib3.exceptions import SSLError as _SSLError
|
||||
from .packages.urllib3.exceptions import HTTPError as _HTTPError
|
||||
from .packages.urllib3 import connectionpool, poolmanager
|
||||
from .packages.urllib3.filepost import encode_multipart_formdata
|
||||
from .cookies import extract_cookies_to_jar
|
||||
from .exceptions import (
|
||||
ConnectionError, HTTPError, RequestException, Timeout, TooManyRedirects,
|
||||
URLRequired, SSLError, MissingSchema, InvalidSchema, InvalidURL)
|
||||
@@ -109,10 +110,10 @@ class HTTPAdapter(BaseAdapter):
|
||||
else:
|
||||
response.url = req.url
|
||||
|
||||
return response
|
||||
# Add new cookies from the server.
|
||||
# extract_cookies_to_jar(self.cookies, self, resp)
|
||||
extract_cookies_to_jar(response.cookies, req, resp)
|
||||
|
||||
return response
|
||||
|
||||
|
||||
def close(self):
|
||||
|
||||
+1
-4
@@ -385,10 +385,7 @@ class Response(object):
|
||||
self.reason = None
|
||||
|
||||
#: A CookieJar of Cookies the server sent back.
|
||||
self.cookies = None
|
||||
|
||||
#: Dictionary of configurations for this request.
|
||||
self.config = {}
|
||||
self.cookies = cookiejar_from_dict({})
|
||||
|
||||
def __repr__(self):
|
||||
return '<Response [%s]>' % (self.status_code)
|
||||
|
||||
Reference in New Issue
Block a user