changeset 283:443af82172b0

added a sample of headers for HttpPost lua method
author amazy
date Tue, 17 Sep 2019 09:53:17 +0200
parents d96894c0c554
children bcbe4a9ae8aa
files Sphinx/source/users/lua.rst
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Sphinx/source/users/lua.rst	Thu Sep 12 11:38:30 2019 +0200
+++ b/Sphinx/source/users/lua.rst	Tue Sep 17 09:53:17 2019 +0200
@@ -196,6 +196,14 @@
 The ``headers`` argument is optional and was added in release
 1.2.1. It allows to set the HTTP headers for the HTTP client request.
 
+Example::
+
+   local preview = RestApiGet('/instances/' .. instanceId .. '/preview')
+   local headers = {
+      ["content-type"] = "image/png",
+   }
+   HttpPost("http://localhost/my-web-service/instance-preview", preview, headers)
+
 .. _lua-origin:
 
 Origin of the instances