[BitBucket user: Alain Mazy] [BitBucket date: 2017-03-13.21:51:42] Many of these methods only accept the AET as the body of the POST request but fails if the AET is passed as a single string with the content-type set to application/json. That would be more RestFull to accept json requests as well. in the integratin tests, we do have DoPost(_REMOTE, '/queries/%s/answers/0/retrieve' % a, 'ORTHANC') while we should also accept something like: DoPost(_REMOTE, '/queries/%s/answers/0/retrieve' % a, 'ORTHANC', 'application/json') i.e: ``` static void RetrieveOneAnswer(RestApiPostCall& call) { size_t index = boost::lexical_cast<size_t>(call.GetUriComponent("index", "")); std::string modality; call.BodyToString(modality); ``` instead of that, we should have something like: ``` static void RetrieveOneAnswer(RestApiPostCall& call) { size_t index = boost::lexical_cast<size_t>(call.GetUriComponent("index", "")); if (call.ParseJsonRequest(request)) { modality = request.asString() } else { std::string modality; call.BodyToString(modality); } ```
[BitBucket user: Alain Mazy] [BitBucket date: 2017-07-10.19:12:47] added a test in https://hg.orthanc-server.com/orthanc-tests/changeset/9d09f6f21b60bcc3a2f3623de52ed5d1e7e6ab76 it works already !