3 ms·
This is a total failure to follow any sort of standard. A 504 is a gateway timeout due to the server failing to complete the action, hell, a 400-level for "you
by WrtCdEvrydy 6y ago
This is a total failure to follow any sort of standard.
A 504 is a gateway timeout due to the server failing to complete the action, hell, a 400-level for "you fucked up" would be preferable.
- fastball 6y ago4xx would be what you want anyway, no?
- jholman 6y agoWhat you described: let x = 2 // runs x = 3; // runs x = 3; // runtime error, you made a mistake No, I'd want a balance update to succeed. Even if it's to the same value that it already had.
- wccrawford 6y agoOr at least return a "no change" message, and not a failure result in the 400s or 500s.
- fastball 6y agoI don't think it's clear from the OC that even if they weren't using the wrong HTTP response they would want an update to succeed if it is the same value, at which point 409 could be a reasonable response code.
- pyrale 6y ago304 would be fitting.
- WrtCdEvrydy 6y ago2XX level is for the action succeeding. 4XX level is for the action failing due to the user. 5XX level is for the action failing due to the service/code/infra. In the real world, updating your balance to the same number should be a 200, however in some weird financial world, it may be a 400 because you may not be allowed to set the same balance due to some financial rule. A 500 is a terrible choice unless setting the balance caused an error at your code/infrastructure level.