user1032531 user1032531 - 1 year ago 133
reST (reStructuredText) Question

How should REST API accept boolean values?

Resource 123 has a current configuration state and a default configuration state, and both of these configuration states can be represented by JSON.

A GET request to will return the current configuration state, and a GET request to will return the default configuration state.

How should an API interpret boolean values? For instance:

Answer Source

Whichever way you want it to, it's completely up to you as the architect/designer. true/false is the most syntactically correct version, make sure that one works and add the other options as sugar if you want.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download