7 ms·
> no remotely sane software will automatically perform POST requests to arbitrary urls I'm not a web developer. Out of curiosity, why is that?
by kuu 5y ago
> no remotely sane software will automatically perform POST requests to arbitrary urls
I'm not a web developer. Out of curiosity, why is that?
- motogpjimbo 5y agoFor precisely the reason being discussed here: GET requests can be performed automatically for many reasons. For example, if you've ever pasted a URL into a Slack channel (or similar) and seen the link converted into a thumbnail of the page a few moments later, you've seen a piece of software issue a GET request on your behalf. Now imagine that wasn't a link to a page but a link to an something that modified your account - resetting your password, for example.
- karolist 5y agoPOST requests typically perform modifications on the server based on user action, like POST'ing this comment. GET requests should be idempotent.
- Doxin 5y agoWebsites are generally designed such that GET requests are side-effect free, and POST requests do have side effects. So for example searching on google is a GET request. It doesn't do anything other than serve the requested page. Logging in on the other hand has the side effect of setting cookies and probably writing some stuff to the database, so that's a POST request. These assumptions are so baked into web software that while assuming a GET request won't do anything zany or overly stateful is probably fine, assuming the same for a POST request should probably be considered negligent.