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

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Accessing Thing's Service as REST API

avaidya1
1-Visitor

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>

ACCEPTED SOLUTION

Accepted Solutions
liliu
12-Amethyst
(To:avaidya1)

Hi Aniruddha,

View solution in original post

5 REPLIES 5
liliu
12-Amethyst
(To:avaidya1)

Hi Aniruddha,

Thanks for the reply

liliu
12-Amethyst
(To:avaidya1)

Hi Aniruddha,

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

Lily

Hi Lily,

It worked for me, Thanks

AnnaAn
14-Alexandrite
(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

Announcements


Top Tags