Access Endpoint protected with VueJS

0

I am trying to access the information that an endpoint gives me, but in this case that is an endpoint protected with credentials, username and password. I'm trying to do it with Vue, but I always get error 401.

This is my code:

created () {
    this.$http.get(URL, {
        username: 'xxxxxxx',
        password: 'xxxxx'
     }).then(response => {
          console.log(response)
     })
}

Is this the correct way to get the information? I tried with Postman to see if it worked and with the program it does everything correctly.

    
asked by rubotero 05.05.2018 в 13:38
source

0 answers