view Sphinx/source/plugins/python/extending-rest-api.py @ 1151:ebc0c3323c98

orthonc
author Alain Mazy <am@orthanc.team>
date Mon, 14 Apr 2025 08:57:19 +0200
parents a589668768d7
children
line wrap: on
line source

import orthanc
import pprint

def OnRest(output, uri, **request):
    pprint.pprint(request)
    print('Accessing uri: %s' % uri)
    output.AnswerBuffer('ok\n', 'text/plain')

orthanc.RegisterRestCallback('/(to)(t)o', OnRest)
orthanc.RegisterRestCallback('/tata', OnRest)