Can't change content-type in REST response
I've never had a problem changing the content-type on a response using either %CSP.Page or %CSP.REST until now. No matter where I put the line to set the content-type to "application/json", it stubbornly emits a content-type of "text/html".
In OnPreHTTP: (I tried one at a time)
do %response.SetHeader("content-type", "application/json") // didn't work
set %response.ContentType = "text/plain" // didn't work
The same lines in OnProcessInput() didn't change the output content-type, either.
The class signature is
Class HS.Local.VA.HS.DocRepo.Prefetch.Service.RESTService Extends (Ens.BusinessService, %CSP.REST)
I get the data I'm looking for back in JSON format the way I expected. My consuming app doesn't like the fact that content-type is always text/html.
I've written tons of CSP and never had a problem changing content-type. Not sure what's going on here.
Thanks in advance!!