Answer the question
In order to leave comments, you need to log in
Why does PHP not see the request data sent via Vue.js, but everything is ok via jquery?
in short, the form looks something like this
<form v-on:submit.prevent="onSubmit" >
<input name="name"
type="text"
required
v-model.trim="name">
<input name="email"
type="email"
required
v-model.trim="email">
<textarea name="comment"
required
v-model.trim="comment">
</textarea>
<button type="submit">Записать</button>
</form>
this.$http.post('my_url', {name: this.name});
$.ajax({ url: 'my_url', method: 'post', data: {name: this.name});
Answer the question
In order to leave comments, you need to log in
In short, this is most likely:
https://stackoverflow.com/questions/18866571/recei...
So in the chrome console, look at what is being sent, it's easy for json in the request body to leave
When making a GET request in vue-resource , the second parameter is sent [config]
, not the [body]
request
. So try this.
Documentation https://github.com/pagekit/vue-resource/blob/devel...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question