title: Getting an Access Token with Xml HTTP Request
body: <p>I am having some trouble getting an access token from a site for a web application. The response to the following is</p>
  
  <p><code>"{"error":"invalid_request","error_description":"The grant type was not specified in the request"}"</code>.</p>
  
  <p>I have specified the grant type below but it seems I have not formatted the request correctly.</p>
  
  <p>Any suggestions?    </p>
  
  <pre><code>  var getToken = new XMLHttpRequest(); 
    getToken.onreadystatechange = function() {
      if (this.readyState == 4 &amp;&amp; this.status == 200) {
        document.getElementById("demo").innerHTML =
        this.responseText;
      }
    };
    getToken.open("POST", "https://api2.libcal.com/1.1/oauth/token", true); 
    getToken.send('grant_type=client_credentials','client_id=XXX', 'client_secret=XXXXXXXXXXXXXXXXXXXX');
  </code></pre>