Determine success via HTTP status codes(restful ajax)
Determine success via HTTP status codes(restful ajax)
Hello!
Is it possible to avoid using "success" property in response contents(all kinds of stores for combos, grids etc) and rely on HTTP status codes (2xx, 3xx, 4xx) instead? I know that I can make just ajax requests without it and it works.
I am developing a restful application and this "success" property does not make any sense in the overall logic of my app.
but, extjs's restful is enough for me. i use php symfony mvc. The colletion route config match all extjs's request's url.
only one status code 200 there, so, others will be bad results.
if you want to check state in client further, i think you can pass a custome property in response to processs your requirements.
I would also like to know how to base success off of the HTTP status code. This is the most graceful method of handling server-side issues, as it can handle anything from a validation problem, to a full application crash. If you're application crashes or something else unexpected happens, you don't get the opportunity to return JSON, let alone JSON with a special property.
I'm currently looking at the JSON Reader and Ajax proxy classes to see if I can inherit from them and change this behaviour.