@@ -94,13 +94,15 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque
9494 url ,
9595 data = request_body ,
9696 headers = headers ,
97+ timeout = _request_timeout ,
9798 )
9899 elif content_type == "application/x-www-form-urlencoded" :
99100 r = self .session .request (
100101 method ,
101102 url ,
102103 params = post_params ,
103104 headers = headers ,
105+ timeout = _request_timeout ,
104106 )
105107 elif content_type == "multipart/form-data" :
106108 # must del headers['Content-Type'], or the correct
@@ -114,6 +116,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque
114116 url ,
115117 files = post_params ,
116118 headers = headers ,
119+ timeout = _request_timeout ,
117120 )
118121 # Pass a `string` parameter directly in the body to support
119122 # other content types than JSON when `body` argument is
@@ -124,10 +127,17 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque
124127 url ,
125128 data = body ,
126129 headers = headers ,
130+ timeout = _request_timeout ,
127131 )
128132 elif headers ["Content-Type" ].startswith ("text/" ) and isinstance (body , bool ):
129133 request_body = "true" if body else "false"
130- r = self .session .request (method , url , data = request_body , headers = headers )
134+ r = self .session .request (
135+ method ,
136+ url ,
137+ data = request_body ,
138+ headers = headers ,
139+ timeout = _request_timeout ,
140+ )
131141 else :
132142 # Cannot generate the request from given parameters
133143 msg = """Cannot prepare a request message for provided
@@ -141,6 +151,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque
141151 url ,
142152 params = {},
143153 headers = headers ,
154+ timeout = _request_timeout ,
144155 )
145156 except requests .exceptions .SSLError as e :
146157 msg = "\n " .join ([type (e ).__name__ , str (e )])
0 commit comments