Hacker News new | ask | show | jobs
by cassepipe 1299 days ago
This has no bearing on the project but since I am implementing a toy server I am wondering about the choice of the PUT method. I thought that it was mostly unused (browser don't send PUT requests) and was replaced by POST request most of the time.
2 comments

Browsers will happily send any standard HTTP method including PUT. HTML forms always produce a GET or POST [0], but nowadays most requests are probably made with fetch() etc, not HTML forms.

[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fo...

PUT can be used from XMLHttpRequest as well as fetch() and allows you to build a REST API using JavaScript.