I'm modifying a response sent by a server. To do this I've set up a test API 
that is meant to just send back the IP, in a format like this:{
  "origin": "202.37.75.130"
}
My unmodified code gives me back what I want.What I wish to do as a test is to 
change the name of "origin" to "IP Address", hopefully getting a response like 
this:{
  "IP Address": "202.37.75.130"
}
To do this I've modified my outSequence section of the code, to be this (all 
I've added is the PayloadFactoryMediator section, the filter was there before):
<outSequence>
  <payloadFactory media-type="json">
    <format>{
      "IP Address" : {
      "$1"
      }
      }
    </format>
    <args>
      <arg evaluator="json" expression="$.origin"/>
    </args>
  </payloadFactory>
  <filter source="get-property('CORS_ORIGIN')" regex=".+">
    <then>
      <property name="Access-Control-Allow-Origin" 
expression="get-property('CORS_ORIGIN')" scope="transport"/>
      <property name="Access-Control-Expose-Headers" 
value="Assertion,X-Jwt-Assertion,X-User-Name,X-User-Domain" scope="transport"/>
    </then>
  </filter>
  <send/>
</outSequence>
However, when I curl to the API as before I get a response:curl: (52) Empty 
reply from serverCan anybody tell me what I may have done wrong?
Thanks,
Maz                                       
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to