1. #1
    Sencha User
    Join Date
    Mar 2010
    Vote Rating
    meediake is on a distinguished road


    Question Determine success via HTTP status codes(restful ajax)

    Determine success via HTTP status codes(restful ajax)


    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.

    Best regards

  2. #2
    Sencha User
    Join Date
    Jun 2010
    Vote Rating
    kendoctor is on a distinguished road


    Default i think you could overwirte some methods.but.

    i think you could overwirte some methods.but.

    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.

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Vote Rating
    wardrop is on a distinguished road



    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.

Similar Threads

  1. Replies: 1
    Last Post: 21 Mar 2011, 3:53 AM
  2. Replies: 4
    Last Post: 3 Mar 2011, 10:46 AM
  3. Ajax.on(requestexception) - how to get HTTP status
    By Air_Mike in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 2 Jun 2009, 7:23 AM
  4. HTTP status error 411 with ajax request on Mozilla
    By NicoP in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 26 Nov 2008, 2:52 AM
  5. Aren't Http Status Codes enough?
    By patspam in forum Community Discussion
    Replies: 5
    Last Post: 14 Oct 2007, 8:45 PM

Thread Participants: 2