Skip to content

Commit

Permalink
feat: add more headers
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Oct 28, 2024
1 parent 5dbb2c5 commit 7765059
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python_weather/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from typing import Optional, Tuple
from asyncio import sleep

from . import __version__
from .errors import Error, RequestError
from .constants import _Unit, METRIC
from .base import CustomizableBase
Expand Down Expand Up @@ -112,7 +113,11 @@ async def get(
while True:
try:
async with self.__session.get(
f'https://{subdomain}wttr.in/{quote_plus(location)}?format=j1'
f'https://{subdomain}wttr.in/{quote_plus(location)}?format=j1',
headers={
'Content-Type': 'application/json',
'User-Agent': f'python_weather (https://github.com/null8626/python-weather {__version__}) Python/',
},
) as resp:
resp.raise_for_status()

Expand Down

0 comments on commit 7765059

Please sign in to comment.