Created
May 25, 2018 14:09
-
-
Save marianogonzalez/c6034a0032b3a1f48e7ae4127b6abe6e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<flow name="getStockInfo"> | |
<http:listener path="stock" method="GET" config-ref="httpListener"> | |
<http:response> | |
<http:body> | |
<![CDATA[ | |
%dw 2.0 | |
output application/json | |
--- | |
{ | |
"ticker": attributes.queryParams.ticker, | |
"price": vars.price as Number, | |
"variation": vars.variation as Number | |
} | |
]]> | |
</http:body> | |
</http:response> | |
</http:listener> | |
<http:request path="price" config-ref="httpRequester" target="price"> | |
<http:query-params>#[{'ticker': attributes.queryParams.ticker}]</http:query-params> | |
</http:request> | |
<http:request path="variation" config-ref="httpRequester" target="price"> | |
<http:query-params>#[{'ticker': attributes.queryParams.ticker}]</http:query-params> | |
</http:request> | |
</flow> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment