Skip to main content

Simon Gaeremynck

Member since Nov 15, 2009

Recent Blog Comments By Simon Gaeremynck

  • Using Appropriate Status Codes With Each API Response

    Posted on Mar 17, 2010 at 3:32 PM

    @Marc, For our project it isn't really a requirement, since most (if not all) of our resources are private and related to the logged in user. Anyway, IIRC google does execute javascript before indexing the page. A good example (for us at least ;)) might be paging. Imagine you have a blogpost which... read more »

  • Using Appropriate Status Codes With Each API Response

    Posted on Mar 17, 2010 at 2:34 PM

    We have a similar setup as Rocky. We have a backend which only exposes REST services. It doesn't output any html, js, jsp, .. . (We are capable of running jsp, groovy, jsf, ruby, jython, etc.. but we really choose not to). We also have a frontend which exists solely out of html/css and js. Wheneve... read more »

  • Using Appropriate Status Codes With Each API Response

    Posted on Feb 24, 2010 at 10:25 AM

    Good to see you came to the light side ;) As far as jQuery is concerned, I agree that it isn't very consistent, but if you keep it in mind it's not a big concern (IMHO). I also find that an API gets much cleaner this way. Glad to help, Simon... read more »

  • Handling AJAX Errors With jQuery

    Posted on Nov 16, 2009 at 8:11 AM

    :) If you have full control over the backend which generates the response you should be able to send an approperiate response code. For a full list you can check the w3 page @ http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html However, if you are using AJAX a lot, it might be tricky to get ... read more »

  • Handling AJAX Errors With jQuery

    Posted on Nov 16, 2009 at 4:52 AM

    I would guess that a 400 would do in this case: According to the spec: 400 Bad Request The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. And if need be, you can always send a response message along with the st... read more »

  • Handling AJAX Errors With jQuery

    Posted on Nov 15, 2009 at 7:06 PM

    I don't really see the point in returning the success and errors values since that is already contained in the response headers. Why don't you just respond with the appropriate response code and let the UI deal with it. This is (imho) much cleaner and much more confirm the REST standard jQuery retu... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel