Skip to main content
Solved

How to mange HTTPS calls from device

Hi,

I have one device that can make HTTP GET and POST to a server, but i dont know how to get this information into Thingworx 7.4.

For example, the package sent by device is like this (from network monitor tool): GET https://servername/push.aspx?id=e89b06c4.


​Questions is: how i get that id parameter (or whatever string comes after the "?") into a string property on my thing?

smayerAnswer
1-Visitor

Hi Konrad

You could create a service which gets the id from the Https request. Once you have stripped this you can then put this on to your Thing string id property.


In this example I am using regex:


var httpsRequest = " https://servername/push.aspx?id=e89b06c4";

var myRegexp = /(id=)(.*)/g;

var match = myRegexp.exec(httpsRequest);

me.ID = match[2];

5 replies

5-Regular Member

Hello, Konrad.

For communication using https you'd need to have SSL set up on both the client and the server. Is your device set up to handle this?

-- Craig A.

Translate

Hi Craig,

I expect so yes.

Anyway, for initial testing, http is enough, but I dont know how to get started.

Thanks,

Konrad

Translate

Any recommendations?

Translate
smayer1-VisitorAnswer
1-Visitor

Hi Konrad

You could create a service which gets the id from the Https request. Once you have stripped this you can then put this on to your Thing string id property.


In this example I am using regex:


var httpsRequest = " https://servername/push.aspx?id=e89b06c4";

var myRegexp = /(id=)(.*)/g;

var match = myRegexp.exec(httpsRequest);

me.ID = match[2];

Translate

Hi Sean,

Thanks for the example, i will try it!

Translate