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 for issue #22 for get, post, delete, put, and patch #25

Merged
merged 2 commits into from
Oct 14, 2014
Merged

Fix for issue #22 for get, post, delete, put, and patch #25

merged 2 commits into from
Oct 14, 2014

Conversation

garyrob
Copy link
Contributor

@garyrob garyrob commented Aug 16, 2014

This enables the examples at in the docs which contain extra params and headers, such as

from firebase import firebase
firebase = firebase.FirebaseApplication('https://your_storage.firebaseio.com', None)
result = firebase.get('/users/2', None, {'print': 'pretty'}, {'X_FANCY_HEADER': 'VERY FANCY'})
print result
{'2': 'Jane Doe'}

to work properly. In the current Master version of python-firebase, the following error is triggered:

TypeError: get() got multiple values for keyword argument 'connection'

nyc432 added 2 commits August 16, 2014 15:32
post() got multiple values for keyword argument 'connection error
The previous patch only fixed it for get(), although the original issue
was about post(). This fixes is for the rest of the relevant requests.
ozgur added a commit that referenced this pull request Oct 14, 2014
Fix for issue #22 for get, post, delete, put, and patch
@ozgur ozgur merged commit ed516fb into ozgur:master Oct 14, 2014
@ozgur
Copy link
Owner

ozgur commented Oct 14, 2014

👍

@quique123
Copy link

Hi, Im getting the same error:

TypeError: get() got multiple values for keyword argument 'connection'

from this:
from firebase import firebase
firebase = firebase.FirebaseApplication('https://your_storage.firebaseio.com', None)
result = firebase.get('/users', None, {'print': 'pretty'}, {'X_FANCY_HEADER': 'VERY FANCY'})
print result

or this error if i user /users/2:

File "firebaseconnect.py", line 12, in
result = firebase.get('/users/2', None)
File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.py", line 19, in wrapped
return f(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py", line 274, in get
return make_get_request(endpoint, params, headers, connection=connection)
File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.py", line 19, in wrapped
return f(_args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/firebase/firebase.py", line 42, in make_get_request
response.raise_for_status()
File "/usr/lib/python2.7/dist-packages/requests/models.py", line 825, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request

@phaoliop
Copy link

phaoliop commented Oct 5, 2017

I installed from "pip" a few days ago, had the same error and edit in the file "firebase.py" the commit mentioned above in #25 -> 7b1e5df

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.

5 participants