News for hackers. Stuff that matters.
Re:I've been abusing HTTP Status Codes in my APIs for years by m3galinux on Wednesday July 13, 2022 @01:30PM (#32085964)
Completing a "search" SHOULD return a 200 with an empty results set. But a search is "/api/employees?name=Bob", not /api/employees/1199. The former is an endpoint that exists but was unable to find data: it should return the correct data structure normally returned for searches, but with no results. The latter is a direct link to a particular resource, which should 404 if it doesn't exist (as if any other file at a particular path doesn't exist).

There are no comments on this comment yet.