I'm pretty sure this has come up here before but I...
# suitescript
m
I'm pretty sure this has come up here before but I can't find it in the limited search history: I have a Suitelet that's returning a stringified object (using
context.response.write()
) but NetSuite has decided to append some html comments to the end of the stringified object, which is screwing up the parsing of said object. The comments are the type of thing that you'd see at the bottom of any NetSuite page if you viewed the source, like
<!-- 415 s: 2% #17 cache: 0% #1 -->
and
<!-- Not logging slowest SQL -->
. Does anyone have any suggestions for forcing the Suitelet to stick to exactly what I'm asking it to return/write back and not append those comments?
b
set the content type header
👍 1
m
Never mind, I figured it out -
context.response.setHeader()
to set the
Content-Type
appropriately (in this case,
application/json
).
Beat me to it
😁 1