Added xml-to-json policy for "PostFlow", but it effects only
secure host (https:// url), but not default host (http://)
why is it so? and how to solve it?
NOTE: Please let me know if you need anything else.
Solved! Go to Solution.
Check if your proxy is deployed to the default virtual host.
For your request to be handled at both virtual hosts. In your ProxyEndpoint, configure something similar to
<ProxyEndpoint name="default"> <HTTPProxyConnection> <BasePath>/path</BasePath> <VirtualHost>secure</VirtualHost> <VirtualHost>default</VirtualHost> </HTTPProxyConnection> </ProxyEndpoint>
The way http://mocktarget.apigee.net/xml works is that if the services gets the same request call, it returns a 304 with ETag (cache header). The browser caches the info and returns that there is no change to the response, so the client just shows the cached response. And for this response, the Content-Type is not set and the content length is 0 as well (You can find it in trace), hence the XML to JSON policy does not execute as expected.
However this works in POSTMAN because Postman adds a token to every call you make, so the backend treats each as a separate request. Hope that clarifies !
This has nothing to do with the client you use, its just that the backend response differs with the calls coming in and the clients manipulates accordingly