Tag Info

New answers tagged


404 is perfectly fine for this use case. 4xx status codes are client error codes, so browser treats them as such, and that is perfectly fine too. Another kind of APIs (e.g. JSON-RPC) use different approaches, but since you're going RESTful, do not change response code just to make console output look pretty - it is not a use case, users are not supposed to ...


SQL concatenation applications like this benefit from a technique which I will call "1=1". I don't know Lua, so I'm going to use "pseudo-Lua." sql = "SELECT * FROM widgets WHERE 1=1 " if id != nil then sql += "AND id LIKE '"..id.."%'" if name != nil then sql += "AND name LIKE '"..name.."%'" If you still need the elseif exclusivity, the only ...


You're not seeing requests because it's not making any; the page is maintaining an open Web Socket connection to the server, and the updates are being pushed from the server to your browser, rather than downloaded at your browser's request.

Top 50 recent answers are included