I have one errorhandling.xsl in the error rule which is used to customize the error message and send back to the client.I have requirement that I have to set 'content-Type' header to application/json, as of now by default it is being set to text/xml.
I tried to set the 'content-Type' header using <dp:set-http-response-header name="'Content-Type'" value="'application/json'"/> but not working as expected.
Could any one please let me know whether I am doing the correct way?
This topic has been locked.
3 replies Latest Post - 2013-02-26T02:38:58Z by devdp
Pinned topic Content-Type in Error rule
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-02-26T02:38:58Z at 2013-02-26T02:38:58Z by devdp
HermannSW 2700006U542751 PostsACCEPTED ANSWER
Re: Content-Type in Error rule2013-02-22T09:09:07Z in response to devdpError rule is different.
> I tried to set the 'content-Type' header using <dp:set-http-response-header name="'Content-Type'" value="'application/json'"/> but not working as expected.
Is setting the Content-Type as very first Transform action in response rule an option for you.
I tested that it works that way.
Re: Content-Type in Error rule2013-02-22T17:37:03Z in response to HermannSWHi Hermann,
Thanks for the reply...
I am trying to set the content-Type header in error rule.I want to know how can I set that in error rule...
Could you please let me know how can I do?
Re: Content-Type in Error rule2013-02-26T02:38:58Z in response to devdpHi Hermann,
I am calling one common error handling rule in my error rule.So I am trying to set the content-Type header in the last action of common error handling rule.
But it is not working as expected.