diff --git a/src/onepasswordconnectsdk/async_client.py b/src/onepasswordconnectsdk/async_client.py index 7df6ad1..f7e357b 100644 --- a/src/onepasswordconnectsdk/async_client.py +++ b/src/onepasswordconnectsdk/async_client.py @@ -1,7 +1,6 @@ """Python AsyncClient for connecting to 1Password Connect""" import httpx from httpx import HTTPError -import json from typing import Dict, List, Union import os @@ -361,8 +360,8 @@ def build_request(self, method: str, path: str, body=None) -> httpx.Response: """ if body: - serialized_body = json.dumps(self.serializer.sanitize_for_serialization(body)) - response = self.session.request(method, path, data=serialized_body) + sanitized_body = self.serializer.sanitize_for_serialization(body) + response = self.session.request(method, path, json=sanitized_body) else: response = self.session.request(method, path) return response diff --git a/src/onepasswordconnectsdk/client.py b/src/onepasswordconnectsdk/client.py index a62bae1..2b40327 100644 --- a/src/onepasswordconnectsdk/client.py +++ b/src/onepasswordconnectsdk/client.py @@ -368,8 +368,8 @@ def build_request(self, method: str, path: str, body=None) -> httpx.Response: """ if body: - serialized_body = json.dumps(self.serializer.sanitize_for_serialization(body)) - response = self.session.request(method, path, data=serialized_body) + sanitized_body = self.serializer.sanitize_for_serialization(body) + response = self.session.request(method, path, json=sanitized_body) else: response = self.session.request(method, path) return response