myatsu commited on
Commit
420c4a8
·
verified ·
1 Parent(s): 1fc71a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,10 +16,10 @@ def get_weather(city: str)-> str: #it's import to specify the return type
16
  """
17
  try:
18
  api_url = f"https://api.weather.com/v1/location/{city}"
19
- header = {
20
  "Authorization" : "Bearer fc5de4ef7812c4aa77860ca1874f8ef9"
21
  }
22
- response = requests.get(api_url, header = headers, timeout = 10)
23
  if response.status_code ==200:
24
  data = response.json()
25
  weather_info = data.get("weather", "No weather information available")
 
16
  """
17
  try:
18
  api_url = f"https://api.weather.com/v1/location/{city}"
19
+ headers = {
20
  "Authorization" : "Bearer fc5de4ef7812c4aa77860ca1874f8ef9"
21
  }
22
+ response = requests.get(api_url, headers = headers, timeout = 10)
23
  if response.status_code ==200:
24
  data = response.json()
25
  weather_info = data.get("weather", "No weather information available")