Closed ylemarechal closed 1 year ago
That's a very good point. Ideally, I would like the various utility functions to return the raw response, but this is unfortunately not possible in many cases. For example, find_series()
accumulates results via several calls to Orthanc, which means that we would have several responses to collect (which is not very elegant).
For the moment, I suggest checking if it is a return_raw_response
, and if it is True
, we make a copy of the client with return_raw_response=False
. What do you think @ylemarechal ?
It is a good option. Thank you
Fixed in #42
Bugfix has been released in PyOrthanc v1.12.3
This code is working :
But this one is KO :
We get this error
from this line.
When raw_reponse option is enabled, methods using requests are ko when they are waiting for response.content and get response body instead.
A possibility would be to keep raw_response in inner methods and return content (according to return_raw_response option) in higher levels. @gacou54, what do you think ?