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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

HTTP request

ak-31
1-Newbie

HTTP request

Hello,

How can I send HTTP requests from thingworx to another server?

My request looks like

http://XXX.XXX.XXX.XXX:7777/set?Status=true

I tried to solve it with link widget, but it always opens a new tab, so it is not a right way for me now.

1 ACCEPTED SOLUTION

Accepted Solutions

You should do it from Server Side Javascript ( from a service on a Thing ), from there you can make http calls with the "ContentLoaderFunctions" Resources, for instance with:

var result = Resources["ContentLoaderFunctions"].GetText(

{

  proxyScheme: undefined /* STRING */,

  headers: undefined /* JSON */,

  ignoreSSLErrors: undefined /* BOOLEAN */,

  useNTLM: undefined /* BOOLEAN */,

  workstation: undefined /* STRING */,

  useProxy: undefined /* BOOLEAN */,

  withCookies: undefined /* BOOLEAN */,

  proxyHost: undefined /* STRING */,

  url: undefined /* STRING */,

  timeout: undefined /* NUMBER */,

  proxyPort: undefined /* INTEGER */,

  password: undefined /* STRING */,

  domain: undefined /* STRING */,

  username: undefined /* STRING */

});

View solution in original post

2 REPLIES 2

You should do it from Server Side Javascript ( from a service on a Thing ), from there you can make http calls with the "ContentLoaderFunctions" Resources, for instance with:

var result = Resources["ContentLoaderFunctions"].GetText(

{

  proxyScheme: undefined /* STRING */,

  headers: undefined /* JSON */,

  ignoreSSLErrors: undefined /* BOOLEAN */,

  useNTLM: undefined /* BOOLEAN */,

  workstation: undefined /* STRING */,

  useProxy: undefined /* BOOLEAN */,

  withCookies: undefined /* BOOLEAN */,

  proxyHost: undefined /* STRING */,

  url: undefined /* STRING */,

  timeout: undefined /* NUMBER */,

  proxyPort: undefined /* INTEGER */,

  password: undefined /* STRING */,

  domain: undefined /* STRING */,

  username: undefined /* STRING */

});

It works, thank you!

Top Tags