Join GitHub today
XMLRPC boolean encoding #8
I need to test this but I think that the standard xmlrpc library of python will only accept 1 and 0 for boolean
Your server should handle any reasonable representation of a value. My server understands numbers or literals for booleans.
This follows half of Postel's Robustness Principle -- be liberal in what you accept.
At this stage, almost 20 years since the protocol was first deployed, you should start with the spec, and if you're not sure how to proceed, look at the examples in the spec and do what they do. Because that's likely what the people who came before did. Certainly all servers support the spec and the examples.
If it's still not clear, I'd look at the Python implementation as you're doing, also PHP or Java and do what they do. Servers would be certain to have tested with those three big implementations.
But it's very new, and I don't know of anyone who has deployed with it, so I could change what it does.
After some research, it seems that only PHP handle both true and 1. This Apache Java library documentation only mention 0 and 1 for boolean. And as stated above it seems that the python library only accept 0 and 1 without throwing an error.