From 2fc15290a82be4ee113996eb4386dba9863684ed Mon Sep 17 00:00:00 2001 From: Mark Southern Date: Fri, 21 Feb 2025 16:06:20 -0800 Subject: [PATCH] return state from call to ODataConnection.execute_patch --- odata/connection.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/odata/connection.py b/odata/connection.py index 08e10bb..0c9f623 100644 --- a/odata/connection.py +++ b/odata/connection.py @@ -184,6 +184,12 @@ def execute_patch(self, url, data, extra_headers=None): response = self._do_patch(url, data=data, headers=headers) self._handle_odata_error(response) + response_ct = response.headers.get('content-type', '') + if response.status_code == requests.codes.no_content: + return + if 'application/json' in response_ct: + return response.json() + # no exceptions here, PATCHing to Actions may not return data def execute_delete(self, url, extra_headers=None): headers = {}