【问题标题】:Axios then method how to get the text sent from express. Using React Native and Axiosaxios 然后方法如何获取从快递发送的文本。使用 React Native 和 Axios
【发布时间】:2023-02-04 23:53:43
【问题描述】:

我正在制作一个应用程序的原型,但我无法收到与

快递寄送方式

    express api sends this.

res.send("monday");

我的前端 React Native

 let ti = await axios.post("http://localhost:3000/login", 
     
                  {
                    
                      celular: celular,
                      senha: senha,
                    
                    },
                    {
                      headers: {
                        Accept: "application/json",
                        "Content-Type": "application/json;charset=UTF-8",
                      }
                    }
              ).then( e => {
               
                Alert.alert(e.status) //ok, status is there
                Alert.alert(e.text())  // how to get the 'monday' text?


              


              })

【问题讨论】:

    标签: javascript react-native http axios


    【解决方案1】:

    它是“e.data”,我不得不查看控制台上的响应对象,这非常令人困惑,但我找到了它。

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 2021-12-05
      • 2020-11-21
      • 1970-01-01
      • 1970-01-01
      • 2020-05-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-21
      相关资源
      最近更新 更多