title: How to make an AJAX request to post JSON data and process the response
body: <p>I need to post JSON data to an URL and process the response which is also JSON data. How can I do this using vanilla javascript, i.e with no third-party libraries? I also need to set request headers. Please could someone give me an example on how to do this?</p>