Re: [json] Glad to be here, some questions?
On Tue, Jul 21, 2009 at 3:01 PM, Kris Zyp<kriszyp@...> wrote:
>> AFAICT, very few JSON services use application/json, so your code
>> should be tolerant of responses with other Content-Type header values.
> Yes, the web is awash with abuses, so it is wise to be tolerant of
> responses, but I wouldn't recommend contributing to the mess. Dojo's
> JSON HTTP/REST client (JsonRestStore) does properly set the Content-Type
> to application/json for same-origin PUT and POST requests. Needless to
> say that is the client I would recommend :). (of course I am biased, and
> I am sure web_send is good as well, Tyler's work is excellent).
I fully agree -- I would prefer using proper content/media types,
since those do serve purpose esp. regarding intermediaries.
Another thing to consider is that JSON is hardly only sent by
browsers: most of my own use cases are for services communicating (or
in general non-browser clients). So it is not reasonable to assume
that most decisions be driven by what browsers do -- yes, JSON is
convenient for that use case, but applicability extends well beyond
-+ Tatu +-