Hacker News new | ask | show | jobs
by dexen 2538 days ago
>Is this a correct place to use 'GET'?

Not at all; GET requests are specified [0] to not cause any modifications to the resources (aside of meta-data like logging etc.). It should also be 100% safe for web spiders to issue any GET at any time [1], server overload aside.

I presume it's an artifact of earlier implementation -or just an idea- to have the collapse work without JavaScript. It would be doable with a normal A HREF with the current link format of https://news.ycombinator.com/collapse?id=20336970

--

[0] "In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval." - https://tools.ietf.org/html/rfc2616#section-9.1.1

[1] in the early day of the internet, a friend lost most of his CRM's content because he had record deletes implemented as A HREF issuing GET requests. Having learned the lesson, he instead turned to JavaScript code issuing GETs...

4 comments

I thought that the normal way to have this work without JavaScript would be to have a form tag with the submit button styled to look like the collapse button.
The 'logout' button is also a GET request.
with get you can also have multiple inserts when some network things break. because get requests might be retried.
The weight of a well used ellipsis...