|
98 | 98 | "orderreddict external dependency installed.") |
99 | 99 | raise exc(message) |
100 | 100 | import copy |
| 101 | +import json |
101 | 102 | import keyword |
102 | 103 | import re |
103 | 104 | import time |
@@ -404,7 +405,8 @@ def _modify(self, **patch): |
404 | 405 | # Handles ConnectionAborted errors |
405 | 406 | for i in range(0, 30): |
406 | 407 | try: |
407 | | - response = session.patch(patch_uri, json=patch, **requests_params) |
| 408 | + response = session.patch( |
| 409 | + patch_uri, data=patch, **requests_params) |
408 | 410 | break |
409 | 411 | except ConnectionError as ex: |
410 | 412 | if 'Connection aborted' in str(ex) and i < 29: |
@@ -451,6 +453,7 @@ def _prepare_request_json(self, kwargs): |
451 | 453 | kwargs.pop('check') |
452 | 454 | od.update(kwargs) |
453 | 455 | return od |
| 456 | + kwargs = json.dumps(kwargs, ensure_ascii=False).encode('utf-8') |
454 | 457 | return kwargs |
455 | 458 |
|
456 | 459 | def _iter_list_for_dicts(self, check_list): |
@@ -588,7 +591,8 @@ def _update(self, **kwargs): |
588 | 591 | # @see https://github.com/requests/requests/issues/2364 |
589 | 592 | for i in range(0, 30): |
590 | 593 | try: |
591 | | - response = session.put(update_uri, json=data_dict, **requests_params) |
| 594 | + response = session.put( |
| 595 | + update_uri, data=data_dict, **requests_params) |
592 | 596 | self._meta_data = temp_meta |
593 | 597 | self._local_update(response.json()) |
594 | 598 | break |
@@ -993,7 +997,8 @@ def _create(self, **kwargs): |
993 | 997 | # Handles ConnectionAborted errors |
994 | 998 | for i in range(0, 30): |
995 | 999 | try: |
996 | | - response = session.post(_create_uri, json=kwargs, **requests_params) |
| 1000 | + response = session.post( |
| 1001 | + _create_uri, data=kwargs, **requests_params) |
997 | 1002 | break |
998 | 1003 | except ConnectionError as ex: |
999 | 1004 | if 'Connection aborted' in str(ex) and i < 29: |
|
0 commit comments