错误语法错误:使用paramsquery在位置0的JSON中出现意外令牌<

时间:2019-12-09 11:50:05

标签: react-native-android

使用实时服务器的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,

                          })
                        });

0 个答案:

没有答案