4 ms·
> * Rejects if not 200. There are other valid 20x return codes that indicate success, such as 202 Accepted and 204 No Content.
by pimlottc 12y ago
> * Rejects if not 200.
There are other valid 20x return codes that indicate success, such as 202 Accepted and 204 No Content.
- antihero 12y agoIndeed. It's kinda of a thing to think about as, presumably, one would want to do something special in those scenarios. I guess a discussion would be a bunch of example situations and whether they needed to be treated specially. I'll make if status >= 200 and < 300, we accept it in the next version.
- VeejayRampay 12y agoIsn't 201 the code for a successful resource creation as well?
- glenjamin 12y agoThe error logic I tend to use for HTTP status codes is >= 400 as those are explicitly marked as errors in the spec.
- Igglyboo 12y agoIn xr.js you can see them checking for a status code >= 200 and < 300 so the documentation is wrong, it rejects if not 2XX. EDIT: Apparently this was changed recently and was actually broken at time of posting.