Skip to content

Comments

[PATCH] Update the routes.py, resolves 9#10

Open
hwelch-fle wants to merge 6 commits intoThrough-the-Trees:mainfrom
hwelch-fle:fix-routes
Open

[PATCH] Update the routes.py, resolves 9#10
hwelch-fle wants to merge 6 commits intoThrough-the-Trees:mainfrom
hwelch-fle:fix-routes

Conversation

@hwelch-fle
Copy link
Contributor

Changes

Allow: Route.__call__(**call_options)

This allows a route to be changed when it is called. useful if we want to construct an endpoint and pass data later

Use **overrides in register_route

All parameters passed to the Route initilizer are now dumped into **overrides variadic.

if json_request:
    overrides['json'] = params
else:
    overrides['params'] = params
    
if isinstance(self.handler, HTTPX_Sync) and json_request:
    return SyncRoute(method, endpoint, self.handler, **overrides)

this fixes #9 and cleans up the branching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Updated parameter handling in routes.py

1 participant