[Python] Fix object serialization for multipart requests (#18140)

* Fix multipart object serialization

* Update samples
This commit is contained in:
Poolmann
2024-03-19 11:31:08 +01:00
committed by GitHub
parent e58f19c735
commit b7ea139f77
4 changed files with 8 additions and 0 deletions

View File

@@ -203,6 +203,8 @@ class RESTClientObject:
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
# Ensures that dict objects are serialized
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
r = self.pool_manager.request(
method,
url,

View File

@@ -203,6 +203,8 @@ class RESTClientObject:
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
# Ensures that dict objects are serialized
post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
r = self.pool_manager.request(
method,
url,