Topic
  • 3 replies
  • Latest Post - ‏2013-02-26T02:38:58Z by devdp
devdp
devdp
37 Posts

Pinned topic Content-Type in Error rule

‏2013-02-22T03:22:00Z |
Hi,

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?

dev
Updated on 2013-02-26T02:38:58Z at 2013-02-26T02:38:58Z by devdp
  • HermannSW
    HermannSW
    4750 Posts

    Re: Content-Type in Error rule

    ‏2013-02-22T09:09:07Z  
    Error 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.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
  • devdp
    devdp
    37 Posts

    Re: Content-Type in Error rule

    ‏2013-02-22T17:37:03Z  
    • HermannSW
    • ‏2013-02-22T09:09:07Z
    Error 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.

     
    Hermann<myXsltBlog/> <myXsltTweets/>
    Hi 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?

    dev
  • devdp
    devdp
    37 Posts

    Re: Content-Type in Error rule

    ‏2013-02-26T02:38:58Z  
    • devdp
    • ‏2013-02-22T17:37:03Z
    Hi 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?

    dev
    Hi 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.

    dev