Mercurial > hg > orthanc-book
comparison Sphinx/source/users/lua.rst @ 237:1a701dfdfcad
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 04 Apr 2019 16:29:17 +0200 |
parents | f58c0784453d |
children | eaad8233e474 |
comparison
equal
deleted
inserted
replaced
236:f58c0784453d | 237:1a701dfdfcad |
---|---|
132 * ``RestApiGet(uri, builtin)`` | 132 * ``RestApiGet(uri, builtin)`` |
133 * ``RestApiPost(uri, body, builtin)`` | 133 * ``RestApiPost(uri, body, builtin)`` |
134 * ``RestApiPut(uri, body, builtin)`` | 134 * ``RestApiPut(uri, body, builtin)`` |
135 * ``RestApiDelete(uri, builtin)`` | 135 * ``RestApiDelete(uri, builtin)`` |
136 | 136 |
137 The parameters: | 137 Here is a description of the parameters: |
138 | 138 |
139 * ``uri`` specifies the resource being accessed, do not include URL schema, hostname or port. (For example: '/instances' ) | 139 * ``uri`` specifies the resource being accessed |
140 | 140 (e.g. ``/instances``). It must not include the URL schema |
141 * ``body`` is a json-formatted string containing the body of a POST or PUT request. (For example: '{"Keep":"StudyDate"}' ) | 141 (protocol), hostname or port. |
142 | 142 |
143 * ``builtin`` is an optional Boolean that specifies whether the request targets only the built-in REST API of Orthanc (if set to ``true``), or the full the REST API after being tainted by plugins (if set to ``false``). | 143 * In the context of a POST or PUT request, ``body`` is a string |
144 | 144 containing the body of the request |
145 For example: | 145 (e.g. ``{"Keep":"StudyDate"}``). This string will often correspond |
146 | 146 to a JSON-formatted version of a `Lua table |
147 RestApiPost('/instances/5af318ac-78fb-47ff-b0b0-0df18b0588e0/anonymize', '{}') | 147 <http://lua-users.org/wiki/TablesTutorial>`__. The ``DumpJson()`` |
148 function (see below) is very useful to achieve this conversion from | |
149 a Lua table to a plain string. | |
150 | |
151 * ``builtin`` is an optional Boolean that specifies whether the | |
152 request targets only the built-in REST API of Orthanc (if set to | |
153 ``true``), or the full the REST API after being tainted by plugins | |
154 (if set to ``false``). | |
155 | |
156 .. highlight:: bash | |
157 | |
158 For instance:: | |
159 | |
160 RestApiPost('/instances/5af318ac-78fb-47ff-b0b0-0df18b0588e0/anonymize', '{}') | |
161 | |
148 | 162 |
149 General-purpose functions | 163 General-purpose functions |
150 ^^^^^^^^^^^^^^^^^^^^^^^^^ | 164 ^^^^^^^^^^^^^^^^^^^^^^^^^ |
151 | 165 |
152 The Lua engine of Orthanc contain several general-purpose ancillary | 166 The Lua engine of Orthanc contain several general-purpose ancillary |