title: REST API from Javascript - Invalid HTTP status code 405
body: <p>new Parse developer here looking for some help.</p>
  
  <p>I'm trying to call the REST API from my app to log custom analytics, but for some reason the XMLHttpRequest I'm making fails with the error message:</p>
  
  <pre><code>XMLHttpRequest cannot load https://api.parse.com/1/events/marker. Invalid HTTP status code 405 
  </code></pre>
  
  <p>Here is the code I am using to make the request:</p>
  
  <pre><code>xmlhttp.open("POST", "https://api.parse.com/1/events/marker", true);
  xmlhttp.setRequestHeader("X-Parse-Application-Id","appidhere");
  xmlhttp.setRequestHeader("X-Parse-REST-API-Key","apikeyhere");
  xmlhttp.setRequestHeader("Content-Type","application/json");
  xmlhttp.send('{"dimensions":{"action":"showDetails"}}');
  </code></pre>
  
  <p>This is the console output:</p>
  
  <pre><code>OPTIONS https://api.parse.com/1/events/marker  (index):3639(anonymous function) (index):3639S.trigger main.js:15(anonymous function) VM625:31(anonymous function) VM623:11S.trigger main.js:15L.zc VM622:132L.nn VM622:132(anonymous function) main.js:13S.trigger main.js:15L.kl VM622:116(anonymous function) main.js:16
  XMLHttpRequest cannot load https://api.parse.com/1/events/marker. Invalid HTTP status code 405` 
  </code></pre>
  
  <p>The strangest thing though is that when I make the request using the curl example in the documentation it works perfectly fine. :/ Any ideas what I'm doing wrong? Hoping it's something simple that I'm overlooking. Thanks!</p>