4 ms·
Why is JSON ok, then? Its structure would be just as custom, and a browser can't read it either. (also the entire world does not revolve around browsers)
by bct 17y ago
Why is JSON ok, then? Its structure would be just as custom, and a browser can't read it either.
(also the entire world does not revolve around browsers)
- JulianMorrison 17y agoJSON's syntax, at least, is defined. Also using JSON implies that extra stuff will be ignored and missing stuff rendered as null rather than causing the parser to crash - it's a forgiving format. Meanwhile it's a lot lighter than XML/HTML. And of course, I'm envisaging use of the "Accept" header to pick a format. Browsers ask for HTML. API users might ask for JSON.
- bct 17y agoI agree with all your points, but none of them have anything to do with how "REST" something is.