Correct way of posting JSON using fetch

there are so many ways of doing this and to no avail =(
this is just a documentation for myself for future reference