Skip to main content
August 4, 2017
Solved

How to mange HTTPS calls from device

  • August 4, 2017
  • 2 replies
  • 2905 views

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?

Best answer by smayer

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];

2 replies

5-Regular Member
August 4, 2017

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.

August 7, 2017

Hi Craig,

I expect so yes.

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

Thanks,

Konrad

August 8, 2017

Any recommendations?

smayer1-VisitorAnswer
1-Visitor
January 22, 2018

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];

January 22, 2018

Hi Sean,

Thanks for the example, i will try it!