【发布时间】:2018-08-31 00:16:53
【问题描述】:
我在我的代码中使用 Axios,当我尝试为 API 发送数据时,控制台中会出现一条消息“错误网络错误”
这是我的代码:
salvar() {
axios.post('http://easypasse.com.br/gestao/wsCadastrar.php',
{ nome: this.state.nome, cpf: this.state.cpf, senha: this.state.senha, method: 'app-set-usuario', "plataforma": 'ios'},
{headers: {'Content-Type': 'application/json'}
})
.then(function(response){
console.log(response)
})
.catch(function(error) {
console.log('Erro ' + error.message);
});
}
为什么会出现这个问题?
【问题讨论】:
标签: ios react-native axios