Answer the question
In order to leave comments, you need to log in
Why is POST not being sent via Vue Resource?
get_data() {
this.$http
.post("/call.php", {
params: { foo: "bar" },
headers: { "Content-Type": "application/json" },
})
.then(
(response) => {
// success callback
},
(response) => {
// error callback
}
);
},
Answer the question
In order to leave comments, you need to log in
Man, if you're using vue-cli, random files you just drop somewhere won't magically appear in the built-in server. The public folder is intended for publicly accessible files.
However, the built-in vue-cli server cannot and should not be able to execute php, this is a completely different language and technology.
For development, you need to set up a separate php server on a separate port and forward similar requests to it through the vue devserver proxy.
To sell - you need to set up a prod server to your liking.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question