У меня проблемы с получением информации из JSON.Это мой код:
fetch('http://fruitmruit.com/webservice/products/details', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
product : '145',
}),
}).then((response) => response.json())
.then((responseJson) => {
console.log(responseJson)
this.setState({
loading: false,
}, function(){
});
})
.catch((error) => {
console.error(error);
});
}
И проблема в том, что я получаю status : "error"
в console.log ():
![enter image description here](https://i.stack.imgur.com/siDHM.png)
Но в Почтальоне получите status : "ok"
:
![enter image description here](https://i.stack.imgur.com/xtDkd.png)
Может быть, проблема заключается в "http" в URL?Спасибо, что прочитали мой вопрос.