ACTIVVVAATTTEEEEEEE
authorKenneth Reitz <me@kennethreitz.com>
Wed, 17 Aug 2011 06:01:19 +0000 (02:01 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Wed, 17 Aug 2011 06:01:19 +0000 (02:01 -0400)
requests/api.py

index a433b0e..9c923e5 100644 (file)
@@ -15,7 +15,9 @@ import config
 from .models import Request, Response, AuthObject
 from .status_codes import codes
 from .hooks import dispatch_hook
+from .utils import cookiejar_from_dict
 
+from urlparse import urlparse
 
 __all__ = ('request', 'get', 'head', 'post', 'patch', 'put', 'delete')
 
@@ -39,6 +41,11 @@ def request(method, url,
     :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
     """
 
+    if cookies is None:
+        cookies = {}
+
+    cookies = cookiejar_from_dict(cookies)
+
     args = dict(
         method = method,
         url = url,