Access to POST body for REST resources filter in Python

I am implementing REST authorisation using something similar to this example code from the Orthanc Book:

Hello,

The “orthanc.RegisterIncomingHttpRequestFilter(Filter)” function in Python corresponds to the wrapping of the C function “OrthancPluginRegisterIncomingHttpRequestFilter2()” in the Orthanc SDK:

https://sdk.orthanc-server.com/group__Callbacks.html#ga49e34b40e43b222031540ea305246e3f

As can be seen, this filter doesn’t provide access to the body, so you can’t access the body as well in Python.

Regards,
Sébastien-

Hi Steve,

One way to access the body is to overwrite the tools/create-archive REST route in a python plugin, there, you’ll have access to the body in the request object: https://book.orthanc-server.com/plugins/python.html#extending-the-rest-api

HTH

Alain.