I am making a call within a python script using the python plugin:
response = orthanc.RestApiPost(‘/modalities/REMOTEHOROS/echo’, json.dumps({}))
and getting a bytes class as a response. This is distinct from other calls to orthanc.RestApiPost or RestApiGet where I get a response that is parseable into json. If I run json.loads(response), I get the expected json.
If I use a python script on a different host and employ the Rest API via the URL:
session = requests.session()
response = session.Post(‘https://OrthancURL/modalities/REMOTEHOROS/echo’, data={})
I get the usual response that can be parsed into json.
Am I just running into the difference between the python plugin approach and how python requests handles responses? So I should be sure to run a json.loads or some conversion against the orthanc plugin response?
Orthanc 1.9.7
Python plugin: 3.4
John.