您好,下面的示例是我的代码,我想知道为什么不能仅以json格式发送数据并且我收到响应的失败消息,所有内容都已导入并且我正在使用reactjs
fetchData = async () => {
const api_call = await fetch("my ur here", {
method: "Post",
dataType: "JSON",
headers: { "Accept": "application/json","Content-Type": "application/json"},
body: Stringify({"Country": this.state.Country,"Mobile": this.state.Mobile})
});
const response = await api_call;
this.setState({ data : response } );
console.log('log : ',this.state.data);
}