agithub
agithub copied to clipboard
How to handle Api Endpoint dynamically changes
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
Yo can call it like an item like so:
YourAPIClient().rooms[room_id].members.get()
check the code here: https://github.com/mozilla/agithub/blob/4f33627de8e8b8977b83ea009692a97f08c19ac4/agithub/base.py#L78
@marcoslhc thank you very much. It works now!
Doesn't work for me.
str(MyAPIClient().products.some_list[0])
> '/products/some_list/0'
@gene1wood Solved. Assumed products.some_list[0]
queries a collectable, which is not the case.