Created
August 11, 2017 14:03
-
-
Save darrelmiller/03891bc9fe6a662dc0db217d049c6a90 to your computer and use it in GitHub Desktop.
API Management Policy to call darksky API
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
<policies> | |
<inbound> | |
<base/> | |
<rewrite-uri template="@{ | |
var lat = 45.4272878; | |
var lng = -73.871513; | |
var time = "2017-04-03T19:00:00"; | |
return $"forecast/{{forecast-key}}/{lat},{lng},{time}/?exclude=minutely,hourly,daily,flags,alerts&units=us";}"/> | |
<set-backend-service base-url="https://api.darksky.net/"/> | |
</inbound> | |
<backend> | |
<base/> | |
</backend> | |
<outbound> | |
<base/> | |
</outbound> | |
</policies> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment