Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So as a client, being able to check whether I likely have a usable result without parsing out the body has no value whatsoever? I'm not sold.

I think we need to be using HTTP error codes better at the API layer, not ditching them entirely. Building on this example, for an invalid user, how about an HTTP 204 and an empty response body? That gives us a clear "no such user exists" without having to parse JSON out first.

EDIT: for the record, I think that on some level, REST APIs themselves are an abuse of HTTP. JSON didn't even exist for much of the public Internet's first decade, and certainly the early work on HTTP never mentioned such a thing as a REST API. We're already using HTTP for so many things in so many ways that this is somewhat of a Lilliputian discussion.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: