@@ -72,16 +72,20 @@ def _put(url, data, files, auth, headers=None):
72
72
return __return_wrapper (r )
73
73
74
74
75
- def _get (url , params , auth ):
75
+ def _get (url , params , auth , headers = None ):
76
76
if _session is None :
77
77
_init ()
78
78
try :
79
+ post_headers = _headers .copy ()
80
+ if headers is not None :
81
+ for k , v in headers .items ():
82
+ post_headers .update ({k : v })
79
83
r = _session .get (
80
84
url ,
81
85
params = params ,
82
- auth = qiniu . auth . RequestsAuth ( auth ) if auth is not None else None ,
86
+ auth = auth ,
83
87
timeout = config .get_default ('connection_timeout' ),
84
- headers = _headers )
88
+ headers = post_headers )
85
89
except Exception as e :
86
90
return None , ResponseInfo (None , e )
87
91
return __return_wrapper (r )
@@ -108,10 +112,18 @@ def _post_with_auth(url, data, auth):
108
112
return _post (url , data , None , qiniu .auth .RequestsAuth (auth ))
109
113
110
114
115
+ def _get_with_auth (url , data , auth ):
116
+ return _get (url , data , qiniu .auth .RequestsAuth (auth ))
117
+
118
+
111
119
def _post_with_auth_and_headers (url , data , auth , headers ):
112
120
return _post (url , data , None , qiniu .auth .RequestsAuth (auth ), headers )
113
121
114
122
123
+ def _get_with_auth_and_headers (url , data , auth , headers ):
124
+ return _get (url , data , qiniu .auth .RequestsAuth (auth ), headers )
125
+
126
+
115
127
def _post_with_qiniu_mac_and_headers (url , data , auth , headers ):
116
128
return _post (url , data , None , qiniu .auth .QiniuMacRequestsAuth (auth ), headers )
117
129
0 commit comments