# HG changeset patch # User Sebastien Jodogne # Date 1554388157 -7200 # Node ID 1a701dfdfcad2baa86a712bfe0848f731201b50a # Parent f58c0784453d7e92172c772ecfc3b0ceebbdd4cd fix diff -r f58c0784453d -r 1a701dfdfcad Sphinx/source/users/lua.rst --- a/Sphinx/source/users/lua.rst Thu Apr 04 14:19:16 2019 +0000 +++ b/Sphinx/source/users/lua.rst Thu Apr 04 16:29:17 2019 +0200 @@ -134,17 +134,31 @@ * ``RestApiPut(uri, body, builtin)`` * ``RestApiDelete(uri, builtin)`` -The parameters: +Here is a description of the parameters: -* ``uri`` specifies the resource being accessed, do not include URL schema, hostname or port. (For example: '/instances' ) - -* ``body`` is a json-formatted string containing the body of a POST or PUT request. (For example: '{"Keep":"StudyDate"}' ) +* ``uri`` specifies the resource being accessed + (e.g. ``/instances``). It must not include the URL schema + (protocol), hostname or port. -* ``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``). +* In the context of a POST or PUT request, ``body`` is a string + containing the body of the request + (e.g. ``{"Keep":"StudyDate"}``). This string will often correspond + to a JSON-formatted version of a `Lua table + `__. The ``DumpJson()`` + function (see below) is very useful to achieve this conversion from + a Lua table to a plain string. -For example: +* ``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``). - RestApiPost('/instances/5af318ac-78fb-47ff-b0b0-0df18b0588e0/anonymize', '{}') +.. highlight:: bash + +For instance:: + + RestApiPost('/instances/5af318ac-78fb-47ff-b0b0-0df18b0588e0/anonymize', '{}') + General-purpose functions ^^^^^^^^^^^^^^^^^^^^^^^^^