Skip to content

Commit

Permalink
Merge pull request #90 from by3nrique/master
Browse files Browse the repository at this point in the history
Define JSON enconding to UTF-8
  • Loading branch information
cgorman committed Sep 6, 2023
2 parents 4063e75 + f8b7489 commit 39dc8a7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/dicomweb_client/web.py
Expand Up @@ -577,6 +577,7 @@ def get(url, params, stream):
stream=stream
)
if response.content:
response.encoding = 'UTF-8'
decoded_response = response.json()
# All metadata resources are expected to be sent as a JSON
# array of DICOM data sets. However, some origin servers may
Expand Down Expand Up @@ -1587,9 +1588,9 @@ def _invoke_delete_request(url: str) -> requests.models.Response:
response = _invoke_delete_request(url)
if response.status_code == HTTPStatus.METHOD_NOT_ALLOWED:
logger.error(
'Resource could not be deleted. '
'The origin server may not support deletion '
'or you may not have the necessary permissions.'
'Resource could not be deleted. '
'The origin server may not support deletion '
'or you may not have the necessary permissions.'
)
response.raise_for_status()
return response
Expand Down Expand Up @@ -2045,7 +2046,7 @@ def delete_study(self, study_instance_uid: str) -> None:
"""
if study_instance_uid is None:
raise ValueError(
'Study Instance UID is required for deletion of a study.'
'Study Instance UID is required for deletion of a study.'
)
url = self._get_studies_url(_Transaction.DELETE, study_instance_uid)
self._http_delete(url)
Expand Down Expand Up @@ -2440,7 +2441,7 @@ def delete_series(
"""
if study_instance_uid is None:
raise ValueError(
'Study Instance UID is required for deletion of a series.'
'Study Instance UID is required for deletion of a series.'
)
if series_instance_uid is None:
raise ValueError(
Expand Down Expand Up @@ -2683,7 +2684,7 @@ def delete_instance(
"""
if study_instance_uid is None:
raise ValueError(
'Study Instance UID is required for deletion of an instance.'
'Study Instance UID is required for deletion of an instance.'
)
if series_instance_uid is None:
raise ValueError(
Expand Down

0 comments on commit 39dc8a7

Please sign in to comment.