使用实时服务器的api,但在邮递员中对api进行测试时,它使用查询参数,但是如何在react native中使用它来调用api
let response = await fetch(URI + '/staging-somewebsite.com/index.php?route=webservices/api&method=appRegisterUser', {
method: 'POST',
headers: {
'Accept': 'application/json',
},
Params:{
'route': 'webservices/api',
'method': 'appRegisterUser',
},
body: JSON.stringify({
firstname: this.state.firstname,
lastname: this.state.lastname,
email: this.state.email,
mobile_number: this.state.mobile_number,
password: this.state.password,
})
});