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

How to handle Api Endpoint dynamically changes #63

Open
huynq2007 opened this issue Jun 15, 2019 · 4 comments
Open

How to handle Api Endpoint dynamically changes #63

huynq2007 opened this issue Jun 15, 2019 · 4 comments

Comments

@huynq2007
Copy link

Hi there,

How agithub handle the endpoint which is dynamically changed as example below:
api.com/rooms/{room_id}/members
the room_id is a parameter which is dynamically changed.

Thank you

@marcoslhc
Copy link
Collaborator

Yo can call it like an item like so:

YourAPIClient().rooms[room_id].members.get()

check the code here:

>>> GitHub('user','pass').whatever[1][x][y].post()

@huynq2007
Copy link
Author

@marcoslhc
thank you very much. It works now!

@mhorlacher
Copy link

mhorlacher commented Aug 16, 2020

Doesn't work for me.

str(MyAPIClient().products.some_list[0])
> '/products/some_list/0'

@gene1wood gene1wood reopened this Aug 19, 2020
@mhorlacher
Copy link

@gene1wood Solved. Assumed products.some_list[0] queries a collectable, which is not the case.

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

No branches or pull requests

4 participants