私は非常に奇妙な問題に遭遇しています。アプリケーションをプロダクションに入れてPOSTリクエストの1つがPOSTに変わり、同じURLへのGET要求が直接続き、POSTはバックエンド(Laravel)で受信されません。クロムネットワークのタブではちょうどGETのように見えますが、BurpsuiteではPOSTリクエストを見ることができます。生産現場でAxios/XMLHttpRequestがPOSTの代わりにGETを送信しています
責任コード
async store() {
// This prints post
console.log(this.method());
await this.form[this.method()]('/api/admin/users/' + (this.isUpdate() ? this.id : ''));
if (!this.isUpdate()) {
this.form.reset();
}
},
form.post方法コンテンツ
return new Promise((resolve, reject) => {
axios[requestType](url, this.data())
.then(response => {
this.busy = false;
this.onSuccess(response.data);
resolve(response.data);
})
.catch(error => {
this.busy = false;
if (error.response.status == 400) {
return this.displayErrors(error.response.data)
}
this.onFail(error.response.data.errors);
reject(error.response.data);
});
});
あなたは301/302リダイレクトを実行している可能性が最も高いです。たとえば、運用サーバーがすべての 'http'トラフィックを' https'にリダイレクトしようとすると、 'http'へのPOSTは' https'にリダイレクトされますが、GET要求に変換されます。もう少し長く説明すると[この回答](https://stackoverflow.com/questions/35399126/laravel-5-htaccess-https-redirect-on-post-routes-doesnt-work)が表示されます。 – patricus