comparison Sphinx/source/users/lua.rst @ 283:443af82172b0

added a sample of headers for HttpPost lua method
author amazy
date Tue, 17 Sep 2019 09:53:17 +0200
parents eaad8233e474
children be69f8c86f56
comparison
equal deleted inserted replaced
282:d96894c0c554 283:443af82172b0
193 * ``SetHttpCredentials(username, password)`` can be used to setup the 193 * ``SetHttpCredentials(username, password)`` can be used to setup the
194 HTTP credentials. 194 HTTP credentials.
195 195
196 The ``headers`` argument is optional and was added in release 196 The ``headers`` argument is optional and was added in release
197 1.2.1. It allows to set the HTTP headers for the HTTP client request. 197 1.2.1. It allows to set the HTTP headers for the HTTP client request.
198
199 Example::
200
201 local preview = RestApiGet('/instances/' .. instanceId .. '/preview')
202 local headers = {
203 ["content-type"] = "image/png",
204 }
205 HttpPost("http://localhost/my-web-service/instance-preview", preview, headers)
198 206
199 .. _lua-origin: 207 .. _lua-origin:
200 208
201 Origin of the instances 209 Origin of the instances
202 ^^^^^^^^^^^^^^^^^^^^^^^ 210 ^^^^^^^^^^^^^^^^^^^^^^^