cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

How to mange HTTPS calls from device

konrad.waldeck
1-Visitor

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?

ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

5 REPLIES 5

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.

Hi Craig,

I expect so yes.

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

Thanks,

Konrad

Any recommendations?

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

Hi Sean,

Thanks for the example, i will try it!

Announcements


Top Tags