diff --git a/requests/api.py b/requests/api.py index a433b0ed..9c923e50 100644 --- a/requests/api.py +++ b/requests/api.py @@ -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,