8000 Convert dict to json before use requests · tomriverman/wc-api-python@5305963 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5305963

Browse files
Convert dict to json before use requests
1 parent 37ee8d8 commit 5305963

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

woocommerce/api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
__license__ = "MIT"
1111

1212
import requests
13+
import json
1314
from woocommerce.oauth import OAuth
1415

1516

@@ -64,6 +65,9 @@ def __request(self, method, endpoint, data):
6465
else:
6566
url = self.__get_oauth_url(url, method)
6667

68+
if data is not None:
69+
data = json.dumps(data, ensure_ascii=False)
70+
6771
return requests.request(
6872
method=method,
6973
url=url,

0 commit comments

Comments
 (0)
0