Skip to content

Commit 7badee3

Browse files
committed
Parse arbitrary request body to json
1 parent 51a8098 commit 7badee3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

braspag_sdk/utils/base_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def send_request(self, method, uri, data=None, params=None):
3030
headers['Content-Length'] = '0'
3131
elif isinstance(data, ObjectJSON):
3232
body = body.toJSON()
33+
else:
34+
body = json.dumps(body)
3335

3436
if 'Content-Type' not in headers:
3537
headers["Content-Type"] = "application/json"

0 commit comments

Comments
 (0)