Skip to main content
March 25, 2016
Question

Json error

  • March 25, 2016
  • 2 replies
  • 3434 views

Hi,

we are trying to get the content from the url using POSTJSON service. used the below code:

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: "https://public-api.wordpress.com/rest/v1/sites/www.davidjmcclelland.com/posts/" /* STRING */,

  content: undefined /* JSON */,

  timeout: undefined /* NUMBER */,

  proxyPort: undefined /* INTEGER */,

  password: undefined /* STRING */,

  domain: undefined /* STRING */,

  username: undefined /* STRING */

};

// result: JSON

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

But we are getting the error while running the service.

The error is given below :

Error executing service

Wrapped java.net.UnknownHostException: public-api.wordpress.com Cause: public-api.wordpress.com

Thanks,

Aditya Kumar

2 replies

March 26, 2016

Please help us with the error

5-Regular Member
March 28, 2016

Aditya, what version of ThingWorx are you using? There was a fix released recently on versions 6.5.8, 6.6.3 and 7.0.1 regarding not getting any header information back when using PostJSON; but you still should not be getting the error message you're currently seeing. I tested this out on 6.5.9, and I didn't get any errors.

March 29, 2016

Hi Ravi,

We are using 6.5.0 version.

Thanks,

Aditya Kumar

March 30, 2016

Hi,

Is this a problem of proxy or what, due to which i am getting an error?

Error executing service

Wrapped java.net.UnknownHostException: public-api.wordpress.com Cause: public-api.wordpress.com


Is there a way to bypass the proxy or the host exception?


Thanks,

Aditya

5-Regular Member
March 30, 2016

You would need to use GetJSON to get the contents. Are you getting an error when using that as well?