News for hackers. Stuff that matters.
Re:I’ve banned query strings by threatofrain on Saturday May 09, 2026 @08:24PM (#48079715)
A response code of 204 seems more appropriate but the problem is you're not allowed to send further information, which would make that descriptive response... not descriptive enough.
Re:I’ve banned query strings by IgorPartola on Sunday May 10, 2026 @12:05AM (#48080899)
I think of it like this:

/users/ returns a 404 in an API means that this resource does not exist. As in, this is not a part of the API.

/users/123 returns a 404 means this user record does not exist.

Yes this means that a 404 is context dependent but in a way that makes it easier for a human to think of and reason about.

Re:I’ve banned query strings by onion2k on Sunday May 10, 2026 @02:48AM (#48081586)
Yes, and this is obvious if /users/ exists and returns a 400 if the ID is required. That way you can tell the difference between /users/ being there and expecting and ID, and it not being there.
Re:I’ve banned query strings by Xirdus on Sunday May 10, 2026 @01:50AM (#48081354)
Code 204 is just code 200 with the "yes the body really is zero bytes this is not an error it's supposed to be like this" bit set.