changeset 237:1a701dfdfcad

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Apr 2019 16:29:17 +0200
parents f58c0784453d
children a363714813b2
files Sphinx/source/users/lua.rst
diffstat 1 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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
+  <http://lua-users.org/wiki/TablesTutorial>`__. 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
 ^^^^^^^^^^^^^^^^^^^^^^^^^