Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Axios GET not working in Safari browser

I have a simple method getInfo() request that is called on created() in the vue instance. It grabs data from an external api and renders it on the page.

created() {
    this.getInfo();
},
methods: {
    getInfo() {
        let vm  = this;
        let url = [my api url];
        axios.get(url)
          .then(response => {   
              console.log(response);
          })
          .catch(error => {
              console.log(error);
          })
    },

The method works perfectly fine in Chrome, but is completely ignored in Safari (High Sierra, 10.13.2) . Any ideas why this may be occurring? No console errors.

like image 759
sternmd Avatar asked Dec 18 '17 23:12

sternmd


1 Answers

For me I found that if I add / to the end of my endpoint, e.g. /users/ instead of /users it works in Safari and it wasn't before it

like image 116
flppv Avatar answered Sep 22 '22 04:09

flppv