ozgur/python-firebase

Storing data with period

Opened this issue · 4 comments

How would I ever go about storing any data with a period?

firebase.put('/',".", {'print':'silent'})
firebase.put('/',"""{"test":"."}""", {'print': 'silent'})
firebase.put('/test',".", {'print': 'silent'})

All of these will result in a 400 Client Error.

Ok so I figured out that we can do

firebase.put('/',"blah", {'test':'.'},)

But I cannot store in the root using

firebase.put('/',"", {'test':'.'},)

After more digging around, it turns out erroring out is correct, but it would be great to have a nicer error message. I also edited the README in pull #59 to make post/put look more intuitive since I didn't read the entire readme and got confused/wasted a lot of time.

%2E is valid, however using this as a key appears to cause a 400 error to be thrown. I am still trying to track it down, but it looks like it might be an issue with the underlying library (requests). Maybe someone with more python experience could offer some insight?

firebase.put('/test',"foo%2Ebar", {'print': 'silent'})

Firebase does not allow keys to contain a "."

The list of forbidden characters for keys is:

. (period)
$ (dollar sign)
[ (left square bracket)
] (right square bracket)
# (hash or pound sign)
/ (forward slash)
(space)