Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how kwargs are handled with a request #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions tixte/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ def __init__(self, session: Optional[aiohttp.ClientSession] = None) -> None:


async def request(self, route: Route, **kwargs: Any) -> Dict:
async with self.session.request(route.method, route.url, {**route.parameters, **kwargs}) as resp:
kwargs = {**route.parameters, **kwargs}
async with self.session.request(route.method, route.url, **kwargs) as resp:
if resp.status != 200:
raise NotImplementedError("API status was not 200, this hasn't been implemented yet.")

# We're going to assume the API returns Dict for now.
# We'll change this later as I get more info.
return await resp.json()


return await resp.json()