I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
I guess it depends on what you're doing. Logic I use for determining things like this:
If there's a method that exactly matches the required semantics, use it. Usually, this translates to GET, PUT, DELETE, or PATCH in my experience.
If it doesn't modify server-side state and is cachable, it's a GET request.
If it does modify server-side state, but is idempotent, it's a PUT request unless some other request has specific semantics that fit better.
Otherwise, it's a POST request, probably with headers to prevent caching.
The thing is, in reality, if your request doesn't actually fit the first three cases, there arguably isn't a HTTP method that does exactly what you want, and it just makes the most sense to use the de-facto standard catch-all method.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I guess it depends on what you're doing. Logic I use for determining things like this:
GET
,PUT
,DELETE
, orPATCH
in my experience.GET
request.PUT
request unless some other request has specific semantics that fit better.POST
request, probably with headers to prevent caching.The thing is, in reality, if your request doesn't actually fit the first three cases, there arguably isn't a HTTP method that does exactly what you want, and it just makes the most sense to use the de-facto standard catch-all method.