react-native-android - 错误语法错误:在 JSON 中使用 paramsquery 位置 0 的意外标记 <
问题描述
使用实时服务器的 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,
})
});
解决方案
推荐阅读
- ios - 如何在后台队列中获取对象的领域结果,然后在主线程上使用它
- javascript - Vue cli 3 与 apollo 冲突
- c# - 条件运算符。错误 CS0266 无法将类型“int”隐式转换为“byte”
- python - 我可以在 django pre_save 信号中执行查询吗?
- python - 视频未保存在opencv python中
- javascript - 我收到一个对象作为响应,我使用 response.json() 将其转换为 JSON,但随后无法从 json 中获取值?
- javascript - 动态填充 Angularjs 数据表
- python - 运行 opencv image show 程序后内核挂起
- c++ - 自定义数据结构的优势是什么?
- java - PostgreSql 的 Spring Boot 数据源自动配置失败