mirror of
https://github.com/kennethreitz/requests.git
synced 2026-06-05 22:50:18 +00:00
automatic header expansion
This commit is contained in:
+9
-1
@@ -15,7 +15,7 @@ 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 .utils import cookiejar_from_dict, header_expand
|
||||
|
||||
from urlparse import urlparse
|
||||
|
||||
@@ -48,6 +48,14 @@ def request(method, url,
|
||||
|
||||
cookies = cookiejar_from_dict(cookies)
|
||||
|
||||
# Expand header values
|
||||
if headers:
|
||||
for k, v in headers.items() or {}:
|
||||
headers[k] = header_expand(v)
|
||||
|
||||
# headers = [(k, map(header_expand, v)) for k,v in headers.items()]
|
||||
# print headers
|
||||
|
||||
args = dict(
|
||||
method = method,
|
||||
url = url,
|
||||
|
||||
Reference in New Issue
Block a user