Помогите пожалуйста решить проблему делаю post запрос методом axios и file_get_contents('php://input') оказывается пустой
this.url = 'control/data.php'
в PHP дальше
в итоге response.data пусто.
если в php просто на возврат отправляю строку, то она приходит return json_encode('qwe');
this.url = 'control/data.php'
| Код |
|---|
return axios.post(this.url,
{qwe:'re', edc:'ert'}
,
{ headers: {
'Content-type': 'application/json',
'access_token': this.access_token,
'domain': this.domain,
}
}
).then((response) => {
this.mess = response.data
this.mess2 = response
}).catch( error => {
this.mess2 = error
});
|
| Код |
|---|
$result = json_decode(file_get_contents('php://input'), true);
return json_encode($result); |
в итоге response.data пусто.
если в php просто на возврат отправляю строку, то она приходит return json_encode('qwe');