integration_with_other_systems
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
integration_with_other_systems [2019/09/03 14:59] – [Example - connecting to a remote module via its web server] emozolyak | integration_with_other_systems [2020/05/22 10:14] – [GET example] emozolyak | ||
---|---|---|---|
Line 4: | Line 4: | ||
This function is available since version 2.6.4520. | This function is available since version 2.6.4520. | ||
+ | |||
+ | ===== POST example ===== | ||
An example of a program executing an HTTPS request to send data as a file at URL https:// | An example of a program executing an HTTPS request to send data as a file at URL https:// | ||
Line 32: | Line 34: | ||
Note that for SSL certificates correctly function, you need to have an exact local time. If there is a significant deviation of the local clock, https requests may not work. We recommend using time synchronization via NTP server. | Note that for SSL certificates correctly function, you need to have an exact local time. If there is a significant deviation of the local clock, https requests may not work. We recommend using time synchronization via NTP server. | ||
+ | |||
+ | ===== GET example ===== | ||
Example of requesting a number in the GET request at URL http:// | Example of requesting a number in the GET request at URL http:// | ||
Line 50: | Line 54: | ||
</ | </ | ||
+ | ===== Implementing other requests like PUT ===== | ||
+ | |||
+ | To implement other requests, you can indicate for cURL call that you need custom request | ||
+ | |||
+ | <code lua> | ||
+ | function main (userId) | ||
+ | |||
+ | INFO(" | ||
+ | |||
+ | str = '' | ||
+ | | ||
+ | c = cURL.easy_init() | ||
+ | c: | ||
+ | c: | ||
+ | c: | ||
+ | | ||
+ | c:setopt{ | ||
+ | [cURL.OPT_POSTFIELDS] = ' | ||
+ | } | ||
+ | c: | ||
+ | c: | ||
+ | c:close() | ||
+ | |||
+ | INFO(" | ||
+ | end | ||
+ | </ | ||
===== Example - connecting to a remote module via its web server ===== | ===== Example - connecting to a remote module via its web server ===== | ||
integration_with_other_systems.txt · Last modified: 2024/04/04 10:18 by emozolyak