title: How to update JSON file by pure javascript AJAX call through HTTP POST method?
body: <p>First Question:
  I have been trying to figure out how to update a JSON file through HTTP POST method when both files (HTML and JSON files) are on the same server (ex. Godaddy or AWS). At this point, it is working and sending data to the server as expected, but the JSON file is not updating. I believe I am missing something here. Is it Godaddy API? Check out my codes below:</p>
  
  <p>Second Question:
  Is there anyway to add authentication HTTP request? ex. only the user who has access or credential would be able to submit this data change request.</p>
  
  <p>Here is the HTML file</p>
  
  <pre><code>&lt;body&gt;
   &lt;button id="my-button"&gt;Click Me&lt;/button&gt;
   &lt;script&gt;
        document.getElementById('my-button').addEventListener('click', dataRequest);
             function dataRequest (){
                  var xhttp = new XMLHttpRequest();
                  xhttp.open('POST','my-data.json', true);
                  xhttp.send('Name=YOYO&amp;PhoneNumber=777-777-7777');
                 }
   &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is my-data.json</p>
  
  <blockquote>
    <p>{ "Name" : "First Name Last Name",<br>
         "PhoneNumber" : "888-777-9999" }</p>
  </blockquote>
  
  <p>Thank you all for your time</p>