首页 > 解决方案 > 错误语法错误:在 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,

                          })
                        });

标签: react-native-android

解决方案


推荐阅读