Seeking guidance on performing a server call using vue-resource. I'm unsure about how to set the header and send data via Vue.$http.post
Vue.$http.post('http://url/', {
email: 'foo',
password: 'bar'
}, {
headers: {
"Content-Type": "application/json; charset=utf-8"
}
})
.then(response => {
console.log(response);
})
.catch(error => {
console.error(error);
});</questionbody>
<exquestionbody>
<div class="question">
<p>Currently exploring the process of making a server call with vue-resource. Uncertainty around setting the header and sending data using Vue.$http.post</p>
<pre><code>jQuery.ajax({
url: "http://url/",
type: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8",
},
contentType: "application/json",
data: JSON.stringify({
"email": "foo",
"password": "bar
})
})