Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
C0D4681463yWhat if it did work, but there was a error that didn't stop the request from completing?
Or am I changing my API's to now include warnings with 300's? -
@PonySlaystation "Happy little accidents. Let's put a little pipe here and send the exception to /dev/null. Have you ever piped an exception to /dev/null? It's okay. It'll be our little secret"
-Bob FoSS. -
we actually have a client that _requires_ this, because they've got a reverse proxy filtering out all non-successful http-codes, because iT MiGhT lEaK DaTa tO An AtTaCkEr.
-
It is actually not that uncommon. Most login api's will return 200 even when it is a failed login. This includes Google etc.
That's why I do it also on login, on other occasions I use Bad request though -
hjk10157313yThis topic has passed DevRant quite a few times and there is both no official REST standard and very valid reason to do so. These are hyper text TRANSFER PROTOCOL errors not application error codes @aBrokenDonut provides a valid example. Sometimes the HTTP codes have a meaning in gateway/proxy.
Sometimes it's very valid application behaviour:
GET /jobs/12345
{
"error": "/bin/bash: file not found"
"errorCode": 1
}
Must send 200 as getting information about the job succeeded but the job itself encountered an application specific error. Is the job did not exist you should get a 404
Related Rants
-
bittersweet10It's 3:30AM and I'm working. If you work at night, no one can interrupt you. If you sleep during the day, yo...
-
Potherca5My tip for staying productive: **Don't** Take a break. Take a few. Have a nap. Take a stroll outside. Enjoy l...
-
Hazarth15- Go to sleep early - Get up at 5-6 - Drink quality coffee - Work at your desk not from the bed or couch - Don...
Web api response with a 200 status code
{
error: ".......",
errorCode: "..."
}
Grinds my gears
rant
wk247