summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--windy/point_forecast.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/windy/point_forecast.py b/windy/point_forecast.py
index 750ec00..83c328d 100644
--- a/windy/point_forecast.py
+++ b/windy/point_forecast.py
@@ -48,7 +48,7 @@ class Request:
endpoint: str = "/point-forecast/v2"
api: str = "https://api.windy.com/api"
- def json(self):
+ def body(self):
body = {
'key': self.key,
'lat': self.lat,
@@ -60,6 +60,9 @@ class Request:
body['levels'] = [str(x) for x in self.levels]
return body
+ def url(self):
+ return self.api + self.endpoint
+
def point_forecast(request: Request):
- return requests.post(request.api + request.endpoint, json=request.json())
+ return requests.post(request.url(), json=request.body())