Skip to main content
15-Moonstone
February 18, 2020
Solved

EMS HTTP Requests with LSR

  • February 18, 2020
  • 1 reply
  • 1975 views

Hi,

I have an functional EMS with LSR running in a Linux Docker-container which is connected to my Thingworx platform; it's working fine so far. Currently I'm trying to configure a Remote-Thing which contains a service that executes HTTP requests to an third-party endpoint. So that I can lookup the resulting data in my Thingworx platform.

 

My problem is, that I don't know how to write an REST requests with the libraries given with the LSR. The examples of Lua-REST calls that I've found so far require additional libraries (or modules) of which I also don't know how to implement them in the EMS/LSR environment.

 

Does anyone have an working example of an remote thing with an defined service that executes a simple http-requests? Is this even possible with the standard LSR or does it need additional modules?

Best answer by slangley

Hi @DanZ.

 

Have you taken a look at the other SDK's we have available that you might be more comfortable with?  Here is a link to the page where you can access more information.

 

Regards.

 

--Sharon

1 reply

16-Pearl
February 18, 2020

Hi,

Do you have a specific requirement to use LUA to implement such functionality ? Is it because you are familiar with the language ?

DanZ15-MoonstoneAuthor
15-Moonstone
February 18, 2020

No, I'm not familiar at all with .lua. 🙂

 

The reason for using .lua for this is simply for not knowing another way. I've followed the documentations and guides that orchestrate .lua functionality to create services/properties for remote things. So I'm under the impression that this is the recommended/easiest way when working with the EMS.

 

It seems fairly self-explanatory so far... define a service with proper in- and output and say what the service should do. As an workaround I currently execute shell-scripts that are executing the HTTP-Request and return the data to my lua template. But I would like to have it all in .lua itself and just would like to know if this is even possible with the given LSR functionality. And if so: How. 🙂