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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Accessing Thing's Service as REST API

avaidya1
1-Newbie

Accessing Thing's Service as REST API

Hi,

Done basic TW tutorial.

I have written MyThing.myService() that returns JSONObject.

return type=JSON

var ans=op1 * op2;

var Jres = {"answer":ans};

result = Jres;

external clients is only expecting JSON details (highlighted), but the HTTP response contains ThingworxLogo.png and few <TR> <TD> tags as below

how to get rid of these non-JSON data in HTTP response

Regards,

Aniruddha

<HTML><HEAD><TITLE>ThingWorx&#x3a; Thing com.thingworx.things.ConfiguredThing&#x40;4dbad8d7 &#x3a; Response From Execution Of multiply</TITLE><LINK rel='Stylesheet' href='/Thingworx/css/thingworxapi.css' type='text/css'></LINK><META http-equiv='Content-Type' content='text/html'></META><META http-equiv='cache-control' content='no-cache, no-store'></META><META http-equiv='expires' content='-1'></META><META http-equiv='pragma' content='no-cache, no-store'></META></HEAD><BODY><IMG SRC="/Thingworx/images/ThingworxLogo.png"/><BR/><H1>multiply</H1><TABLE><TR><TH>result</TH></TR><TR><TD>&#x7b;&quot;answer&quot;&#x3a;182.0&#x7d;</TD></TR></TABLE></BODY></HTML>

1 ACCEPTED SOLUTION

Accepted Solutions
liliu
8-Gravel
(To:avaidya1)

Hi Aniruddha,

View solution in original post

5 REPLIES 5
liliu
8-Gravel
(To:avaidya1)

Hi Aniruddha,

Thanks for the reply

liliu
8-Gravel
(To:avaidya1)

Hi Aniruddha,

Just let me know if the solution not work for you.

Lily

Hi Lily,

It worked for me, Thanks

AnnaAn
13-Aquamarine
(To:avaidya1)

Hi Vaidya,

If the answer is helpful or your issue is resolved, please mark correct answer to Li Li Liu​ or Mark it Helpful so we will close this topic.

Thanks,

Br,

Anna

Top Tags