4 ms·
There's.... There is a whole.set of status codes for exactly those things!
by Marazan 4y ago
There's.... There is a whole.set of status codes for exactly those things!
- AlexandrB 4y agoWhen used in an API, HTTP acts mostly as a transport layer. There's no HTTP result code for "your request was successful but your Smart Washing Machine is out of detergent", for example.
- Marazan 4y agoThat's a 5xx (assuming the washing machine is the server in this scenario) A problem on remote that may be resolved in the future that will allow a succesful request. You are allowed to attach info to error code responses, there is a body you can put the details in.
- vsnf 4y agoAnd yet your example is perilously close to 418
- cgrealy 4y ago> There's no HTTP result code for "your request was successful but your Smart Washing Machine is out of detergent", for example. That comes down to your definition of success. Yeah, the client successfully connected and the server read the request, but it was unable to process said request. To my mind, that's a 500, as in the server was not able to handle the request due to a circumstances beyond the clients control.