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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to pass json data to GetJSON service

RohitKumar_Jais
4-Participant

How to pass json data to GetJSON service

Hello,

I want to pass json data to GetJSON service through params.

Rest URL: "http://localhost:8080/PumpCurveAnalytics/PumpAnalytics/BaselineJsonData/FlowVsBHP/4"

var params = {

  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: "http://localhost:8080/PumpCurveAnalytics/PumpAnalytics/BaselineJsonData/FlowVsBHP/4" /* STRING */,

  timeout: undefined /* NUMBER */,

  proxyPort: undefined /* INTEGER */,

  password: undefined /* STRING */,

  domain: undefined /* STRING */,

  username: undefined /* STRING */

};

// result: JSON

var jsonData = Resources["ContentLoaderFunctions"].GetJSON(params);

Is there any way to achieve this functionality?

5 REPLIES 5

Hi Rohit Kumar Jaiswal​,

Are you trying to POST the data to some external System/Application OR trying to Retrieve data from some external System/Application?

I want to get JSON data from Rest URL: "http://localhost:8080/PumpCurveAnalytics/PumpAnalytics/BaselineJsonData/FlowVsBHP/4 and also want to pass JSON data to this webservice  while using GetJSON  service.


In url you can see I am passing 4 as a parameter to Rest Webservice so like this way I want to pass json string also while using GetJson service.

Rohit Kumar Jaiswal This service will help you to get Json data as service output is that what you want? or want to Post somewhere else? as Ankit Gupta​ mentioned?

I want to get JSON data from Rest URL: "http://localhost:8080/PumpCurveAnalytics/PumpAnalytics/BaselineJsonData/FlowVsBHP/4 and also want to pass JSON data to this webservice (external application) while using GetJSON  service.


In url you can see I am passing 4 as a parameter to Rest Web service so like this way I want to pass json string also while using GetJson service.


Please help me

To get data form using getJson you need to provide

var params = {

   // headers: undefined,//"{'data'}" /* JSON */,

    ignoreSSLErrors: true /* BOOLEAN */,

    useProxy: true /* BOOLEAN */,

    proxyHost: "Ip" /* STRING */,

    url:"http://localhost:8080/PumpCurveAnalytics/PumpAnalytics/BaselineJsonData/FlowVsBHP/4" /* STRING */,

    timeout: 500 /* NUMBER */,

    proxyPort: 8080 /* INTEGER */,

    password: "Password" /* STRING */,

    username: "Username" /* STRING */

};

// result: JSON

var result = Resources["ContentLoaderFunctions"].GetJSON(params);

AND AT THE END TRY RESULT BY SETTING AS A STRING

Announcements


Top Tags