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

Allow making requests at the root of an API #28

Open
johtso opened this issue Jun 15, 2012 · 4 comments
Open

Allow making requests at the root of an API #28

johtso opened this issue Jun 15, 2012 · 4 comments

Comments

@johtso
Copy link

johtso commented Jun 15, 2012

Unless I've missed something, it doesn't seem to be possible to make a request to the root URL of an API. Maybe instead of returning an API object, you should just get a fully functional resource from the get go?

@dstufft
Copy link
Collaborator

dstufft commented Jun 15, 2012

Yes this is planned for the next release (0.5).

@bancek
Copy link

bancek commented Jul 15, 2012

You could access API root like this:

api.__getattr__('').get()

or even better like this:

getattr(api, '').get()

First way is also useful if your API URL contains reserved words like get, post...

api.files.__getattr__('get').get() # GET /api/v1/files/get

@merwok
Copy link
Contributor

merwok commented Mar 7, 2013

When you have reserved words, doesn‘t api.files('get').get() work?

@dstufft Was this fixed or is it still in planning?

@dstufft
Copy link
Collaborator

dstufft commented Mar 7, 2013

@merwok Don't believe I ever fixed it :/ If I recall I was essentially going to turn the API object into a resource with a different constructor to handle the initial creation.

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