Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
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?
Solved! Go to Solution.
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];
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!