Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
3 replies Latest Post - ‏2013-02-26T02:38:58Z by devdp
devdp
devdp
37 Posts
ACCEPTED ANSWER

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
    4491 Posts
    ACCEPTED ANSWER

    Re: Content-Type in Error rule

    ‏2013-02-22T09:09:07Z  in response to devdp
    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
      ACCEPTED ANSWER

      Re: Content-Type in Error rule

      ‏2013-02-22T17:37:03Z  in response to HermannSW
      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
        ACCEPTED ANSWER

        Re: Content-Type in Error rule

        ‏2013-02-26T02:38:58Z  in response to devdp
        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