Need help with passing WordPress Basic Auth to allow for CRUD operations on posts. I have successfully coded the GET call using vue-resource. But of course, when I try to delete a post I get the 401 Unauthorized error in console.
I have googled and tried many different ways to pass my headers without success.
I am running vue js version: Vue.js v1.0.28
Vue resource version: vue-resource v0.9.3
I have attached a screen shot of my console error:
here is some of my code:
<script type="text/javascript">
Vue.http.headers.common['Authorization'] = 'Basic ZHhsYWRuZXI6cGFzc3dvcmQ';
var apiURL = 'http://localhost/wpdev/wp-json/wp/v2/book/';
new Vue({
el: '#demoList',
data: function() {
return {
wpPosts: ''
}
},
ready: function () {
this.fetchPosts();
},
methods: {
fetchPosts: function () {
this.$http.get(apiURL).then((response) => {
this.$set('wpPosts', response.data)
})
},
deletePost: function(id) {
var ConfirmBox = confirm('Are you sure you want to delete this post '+ id)
if(ConfirmBox) this.$http.delete(apiURL + id)
this.fetchPosts()
},
}
});
</script>

Anyone help please????
with the lack of support I have abandoned Vue in lue of React. . This is how projects like Vue JS does not grow at a good rate and gets left behind.