Very easy example for keyboard and mouse that works with a Feather M0, no special libraries needed, here.
HTTP POST in javascript guide here.
Another nice tutorial here
A tutorial on fetch in particular is here
jquery approach here
more elaborate description here
cross-browser support here
Suggestion of using Accessibility Services, here
18 OCT 2020
Working example here -- presses the 'u' key on a button press.
Working example for multiple buttons here. Video demo here. Or click below: