Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138249

Request failed with status code 401 even when I passed the api token

$
0
0

I'm trying to do a POST request with VueJS in Laravel, but the request failed with 401 status code, I'm passing the token into the headers but it doesn't work.

const post_data = {
   headers: {
      Authorization: [api token]
   },
   params: {
      [parameters]
  }
}
axios
   .post('URL', post_data)
   .then(res => console.log(res))

Viewing all articles
Browse latest Browse all 138249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>