title: trying to call api through xhr in Vuejs ,using promise to store response ,doesnt recognize .then()
body: <p>I am trying to call api through xhr ,since axios is not working,how do i store response in a variable ,if i use promise .then() it throws error ,Below is what i am trying to do </p>
  
  <pre><code>var xhr = new XMLHttpRequest();
  xhr.open('GET', 'http://example.com', true).then(response=&gt;{
  
  console.log(response);
  })
  xhr.send();
  </code></pre>
  
  <p>error ,cannot read then</p>