Trying to create an XML document in-browser (not c...
# suitescript
j
Trying to create an XML document in-browser (not created for download using
N/file
, but rather using
response.write
) in a suitelet. Previously in SS 1.0, I could just use
response.setContentType
, but there doesn’t seem to be an an equivalent in SS 2.0. Does anyone know how to set the content type to XML? I’ve tried
addHeader
and
setHeader
without much luck…
b
though you should have been able to use ServerResponse.setHeader
j
I’m just trying to output the XML to the browser, not create a file, though?
I’m also a little confused how to use ServerResponse.setHeader. It should just be this, right?
Copy code
context.response.setHeader({
     name: 'Content-Type',
	 value: 'application/xml'
});
b
looks okay, though i would have gone with
text/xml
j
Yep. That was it.
text/xml
instead of
application/xml
Thanks for talk through that with me