'Content-Type': 'application/json'
needs to be 'Content-Type': 'application/hal+json'
in order for it to work.
I recommend you watch these video tutorials
Learn Drupal 8 - REST API Part1
Learn Drupal 8 - REST API Part2
The login is covered in part 2, but part 1 is very informative and part 2 will make more sense if you watch part 1.
Although, the video tutorial uses the Google Chrome Postman add-on, your code needs to do the same.
Have a header with Content Type and Authorization
Your URL to POST, GET, or PATCH shouldn't be your user page, unless you're updating the user fields. The URL needs to be whatever page you want to POST, GET or PATCH.
Ex: http://forexample.com/node/1