title: Setting baseUrl for Axios in Vue js sends out request
body: <p>In my app I use Axios to handle my API-requests. In main.js I have set the baseUrl. Without me making a request it makes a request on its own just by setting the baseUrl, so always when the app is loaded in the browser.</p>
  
  <p>In my main.js <code>axios.defaults.baseURL = 'https://domain.nl/path/to/my/api</code></p>
  
  <p>All works fine but a request to the baseUrl gives back a 500 for not requesting data.</p>
  
  <p>The implementation in main.js:</p>
  
  <pre><code>import axios from 'axios'
  import VueAxios from 'vue-axios'
  </code></pre>
  
  <p>config:</p>
  
  <pre><code>axios.defaults.baseURL = https://domain.nl/path/to/my/api
  axios({
  withCredentials: true,
  credentials: 'same-origin',
  headers: { 'content-type': 'application/x-www-form-urlencoded' }})
  </code></pre>
  
  <p>Then in another file I do an <code>export default {}</code> which contains:</p>
  
  <pre><code>getLang(payload) {
  
      payload.method = 'GET'
      payload.url = 'lang';
  
      return axios(payload).then(result =&gt; {
          return result.data
      });
  }
  </code></pre>
  
  <p>Does anyone know how to cancel this request or is there a better way to set the baseUrl without this 'bug?</p>