On Monday 22 January 2007 15:56, Ed C. wrote: > This seems like almost a duplication of effort -- we already have access to > the HTTP status codes, which could (should?) be used to determine success > (example, 200 = OK, 500 = Error). The content body includes the results or > error message(s). > HTTP 500 is generally used to signal an application error somewhere in the system (the database is down, you tried to divide by zero, and so on). Similarly, other status codes relate to the status of the attempted HTTP request and response (e.g. 401 = your request requires authentication).
This is a different thing from an application error or status code e.g. 'the object you are trying to update is a stale copy'. X-JSON can also be used for status/update data such as 'you have three outstanding cases, here are their names and ids', to automatically refresh a list in the background, every time you request or update anything in your app (in which case the request body is busy reporting something else). Mislav - yes, X-JSON is a hack, and an acceptable one IMO, with a good pedigree. As you point out, multipart MIME type responses are a hack on top of HTTP - so are CGI parameters, and sessions, if you look at what HTTP was originally designed to do. Dave -- ---------------------- Author Ajax in Action http://manning.com/crane Ajax in Practice http://manning.com/crane2 Prototype & Scriptaculous Quickly http://manning.com/crane3 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
