@@ -180,8 +180,9 @@ The following is the response module source code for Python 3 functions:
180
180
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
181
181
# See the License for the specific language governing permissions and limitations under the License.
182
182
183
- from botocore.vendored import requests
183
+ import urllib3
184
184
import json
185
+ http = urllib3.PoolManager()
185
186
186
187
SUCCESS = "SUCCESS"
187
188
FAILED = "FAILED"
@@ -211,9 +212,7 @@ def send(event, context, responseStatus, responseData, physicalResourceId=None,
211
212
}
212
213
213
214
try:
214
- response = requests.put(responseUrl,
215
- data=json_responseBody,
216
- headers=headers)
215
+ response = http.request('PUT',responseUrl,body=json_responseBody.encode('utf-8'),headers=headers)
217
216
print("Status code: " + response.reason)
218
217
except Exception as e:
219
218
print("send(..) failed executing requests.put(..): " + str(e))
@@ -229,8 +228,9 @@ The following is the response module source code for Python 2 functions:
229
228
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied.
230
229
# See the License for the specific language governing permissions and limitations under the License.
231
230
232
- from botocore.vendored import requests
231
+ import urllib3
233
232
import json
233
+ http = urllib3.PoolManager()
234
234
235
235
SUCCESS = "SUCCESS"
236
236
FAILED = "FAILED"
@@ -260,9 +260,7 @@ def send(event, context, responseStatus, responseData, physicalResourceId=None,
260
260
}
261
261
262
262
try:
263
- response = requests.put(responseUrl,
264
- data=json_responseBody,
265
- headers=headers)
263
+ response = http.request('PUT',responseUrl,body=json_responseBody.encode('utf-8'),headers=headers)
266
264
print "Status code: " + response.reason
267
265
except Exception as e:
268
266
print "send(..) failed executing requests.put(..): " + str(e)
0 commit comments