From 942c69302b143ba0cb65f74bcbaa3e35d494a3bb Mon Sep 17 00:00:00 2001 From: MaddyAustin4 <59646547+MaddyAustin4@users.noreply.github.com> Date: Wed, 23 Aug 2023 11:11:58 +0100 Subject: [PATCH] fix(api): update post req json response (#8) --- kafka_connect_api/kafka_connect_api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kafka_connect_api/kafka_connect_api.py b/kafka_connect_api/kafka_connect_api.py index 128447a..ca9e9d8 100644 --- a/kafka_connect_api/kafka_connect_api.py +++ b/kafka_connect_api/kafka_connect_api.py @@ -384,7 +384,10 @@ def post_raw(self, query_path, **kwargs) -> Response: def post(self, query_path, **kwargs): req = self.post_raw(query_path, **kwargs) - return req.json() + try: + return req.json() + except ValueError: + return req @evaluate_api_return def put_raw(self, query_path, **kwargs) -> Response: