ios post html,laravel - Axios post response is html - Stack Overflow

Good morning all,

i use: "laravel/framework": "^6.2",

"axios": "^0.19",

"vue": "^2.5.17",

I have a problem when I use a axios.put and route put my response.data is right (response.data: "ok") but in my axios.post and route post I receive an html in my response.data and I do not understand why someone can explain me please? and how to get an reponse.data:"ok" in my axios.post?

file .vue

let formData = new FormData();

formData.append('connexion', this.customer);

formData.append('product', this.product);

axios.post('hosting/', formData)

.then(response=> {

console.log(response);

});

file route

Route::post('hosting', ['uses' => 'Api\HostingController@cart']);

file controller

public function cart(Request $request)

{

return 'ok';

}

my response when axios.post

JuN05.png

my response when axios.put

4dRxN.png

thank's all for your help!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值