k***@qq.com
k***@qq.com
  • 发布:2023-07-06 10:06
  • 更新:2023-07-06 10:06
  • 阅读:92

使用uni发送http请求需要引入什么嘛

分类:uni-app
// 比如说仿照官网的示例发一个这样的http请求, 这里面的uni是哪里来的, 需要引入什么嘛  
uni.request({  
    url: 'https://www.example.com/request', //仅为示例,并非真实接口地址。  
    data: {  
        text: 'uni.request'  
    },  
    header: {  
        'custom-header': 'hello' //自定义请求头信息  
    },  
    success: (res) => {  
        console.log(res.data);  
        this.text = 'request success';  
    }  
});
2023-07-06 10:06 负责人:无 分享
已邀请:

要回复问题请先登录注册