Basic working Weather logic
This commit is contained in:
5
apitests/http-client.env.json
Normal file
5
apitests/http-client.env.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dev": {
|
||||
"apikey": "1d25d5c991dca5a0554ed4f59b34d634"
|
||||
}
|
||||
}
|
||||
20
apitests/openweather.http
Normal file
20
apitests/openweather.http
Normal file
@@ -0,0 +1,20 @@
|
||||
### GET Geo Position
|
||||
@city_name = Rivanazzano Terme
|
||||
@country_code = IT
|
||||
@limit = 2
|
||||
GET http://api.openweathermap.org/geo/1.0/direct?q={{city_name}},{{country_code}}&limit={{limit}}&
|
||||
appid={{apikey}}
|
||||
Accept: application/json
|
||||
|
||||
> {%
|
||||
client.global.set("geo", response.body[0]);
|
||||
%}
|
||||
|
||||
### GET Forecast
|
||||
GET api.openweathermap.org/data/2.5/forecast?lat={{geo.lat}}&lon={{geo.lon}}&appid={{apikey}}
|
||||
Accept: application/json
|
||||
|
||||
### GET Now Weather
|
||||
GET http://api.openweathermap.org/data/2.5/weather?lat={{geo.lat}}&lon={{geo.lon}}&appid={{apikey}}
|
||||
Accept: application/json
|
||||
|
||||
Reference in New Issue
Block a user