Mercurial > hg > orthanc-book
annotate Sphinx/source/plugins/python/extending-rest-api.py @ 789:2f70f622059b
added odbc tip
author | Alain Mazy <am@osimis.io> |
---|---|
date | Wed, 24 Nov 2021 15:30:29 +0100 |
parents | a589668768d7 |
children |
rev | line source |
---|---|
703
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 import orthanc |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 import pprint |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 def OnRest(output, uri, **request): |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 pprint.pprint(request) |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 print('Accessing uri: %s' % uri) |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 output.AnswerBuffer('ok\n', 'text/plain') |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 orthanc.RegisterRestCallback('/(to)(t)o', OnRest) |
a589668768d7
moving python samples in separate files (2)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 orthanc.RegisterRestCallback('/tata', OnRest) |