Skip to main content

wizzszz

Member since Sep 4, 2010

Recent Blog Comments By wizzszz

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on May 28, 2014 at 10:16 AM

    @JooJoo, "Tester uses fiddler" - that is your one big killer argument to tip the scales your way? *sigh* And why should anyone need a custom parser?? Are you being serious?? If everybody may change standards at will, there will be (insert arbitrarily big number) of different "flavo... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on May 13, 2014 at 12:26 AM

    @JooJoo, i really have a hard time to take feedback riddled with lols for serious. Nonetheless i'll try to reply: Engineering trade off is just a different term for "diluting the standards" here. Nobody will ever stop you from creating an own (http-like) protocol with silly error codes ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Feb 1, 2014 at 5:32 PM

    @yolk, the http request IS completely valid, because http does neither define nor perform checks of the http payload (that's solely a matter of the business logic). And it's the business logic that refuses to complete the requested action. If you re-read my posts, you will see that i have not bee... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 4, 2013 at 10:40 PM

    @tps12, I see where you're coming from, but yes, we're very likely not going to agree on this... at least not anytime soon... :P I, for one, would be surprised to have a 400 response with body data in the expected format (instead of a placeholder, i.e. human readable text/html instead of the expec... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 4, 2013 at 8:33 PM

    @tps12, I know, but it doesn't make sense to simply repeat 'Bad Request' in the http body. All of the scenarios that i've listed above indicate that the client would not interprete the response correctly/at all anyway. And it makes even less sense to do that when your body contains a JSON string,... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 4, 2013 at 6:38 PM

    @tps12, but 400 is defined as follows (taken from RFC2616): 400 Bad Request The request could not be understood by the server due to malformed syntax. This applies to "malformed syntax" of the header only , because the standard does not define anything related to the body data. T... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 4, 2013 at 3:07 PM

    @tps12, every xmlhttprequest is "geared towards" the full set of request verbs/status codes. If your particular frontend library is using well-documented (read:standardized) methods for other means, it is basically only mimicking http (and WebDAV). SIP mimics http, too, but nobody woul... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 4, 2013 at 1:01 PM

    @Ben, I've never used AngularJS, and very likely never will. What i don't really understand is why you need to use AngularJS to issue a simple AJAX call - AngularJS will call the jQuery ajax method without doubt anyway. And what i don't really believe is that AngularJS kinda leaves you with no o... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 3, 2013 at 6:15 PM

    @Ben, In those old posts, I actually DO return a 200 OK response for all "successful" HTTP requests, and then encapsulate the business-logic-failure within the structure response. Then, I use a response preprocessor to route the response to the error-handler IF the business logic indica... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Apr 2, 2013 at 7:55 PM

    @Ben, you still shouldn't "bend" the standards for that. You have posted a tricky example, because request.done can't call request.fail here directly, but if don't use a lambda style function for fail here and instead pass a static function, you can. var request = getSomeServe... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 29, 2013 at 1:13 PM

    @Ben, own API, own client = do whatever you like. A "488 Ben says: Invalid parameter type" would work fine, too, not sure why you make an effort to find an appropriate existing status code when you don't stick to standards anyway... ;) Every 4xx status code should work fine with any ht... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 27, 2013 at 4:39 PM

    @tps12, Doesn't have much to do with how complex an API is - if it's a basic function, why use advanced status codes? You'll just forfeit the chance that simple/older clients could still use parts of your API, even if they can't handle the advanced parts. (read: maintain backwards compatibility) ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 27, 2013 at 2:12 PM

    @tps12, Frankly, i wouldn't use PUT at all, there are other means to upload a file (i.e. mimic the behaviour of a html FORM elements and send a multipart/form-data encoded body) But, let's say i would need it for a project (not trying to dodge your question here), i'd implement WebDAV (as far as ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 27, 2013 at 11:23 AM

    @tps12, @ben, Why would i respond to a PUT operation with a 200 when an error occurs? That's a plain vanilla http operation, hence the use of http status code is not only justified, it is mandatory. (i.e. 201 Created or something like that) There are, besides WebDAV, no applications using PUT or ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 26, 2013 at 9:49 PM

    @tps12, sorry, didn't realize that you were talking about the DELETE request method. If you are using DELETE, a 403 would be of course appropriate, although a more specific status code would be better - i.e. WebDAV is using a 207 Multi-Status here (see example here: http://tools.ietf.org/html/... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 26, 2013 at 5:18 PM

    @tps12, deleting resources is beyond the scope of http, and that's not the only reason why a 403 would be inappropriate here - many http clients will not even retry a http request when they receive a 403 status code. http only defines access in a yes/no way (basic, digest and nowadays oauth), so ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 26, 2013 at 12:10 AM

    I'm sorry, forgot to answer your question in my last post, so here you go: The hyper text transfer protocol (HTTP) was originally designed by Roy Fielding, Tim Berners-Lee and others at CERN. It is meanwhile maintained by the IETF, just as any other RFC. The "standard" for HTTP/1.1 (RFC ... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 25, 2013 at 11:57 PM

    @Ben, but wasn't that exactly my point to not mix up HTTP transport and business-logic? Granted, it is convenient to report a problem in the http status code already (and save the hassle of parsing the http body), but... ... http status codes all have something in common - they report problems... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 12, 2013 at 4:32 PM

    @tps12, i think you missed my point - the hyper text transfer protocol (http) does not define anything related to the payload (http body data) - all it does is hinting how the body data can be interpreted (by providing a mime type). If a problem arises from the payload (does not matter if syntact... read more »

  • HTTP Status Codes For Invalid Data: 400 vs. 422

    Posted on Mar 11, 2013 at 11:19 AM

    @tps12, A "400 Bad Request" status code indicates that the http request could not be understood - this is pretty much only related to wel-formedness of the request header and rarely (if ever) used when the post data is malformed, and should be used only when the server is unable to inter... 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