LCZ
LCZ
  • 发布:2020-07-09 15:47
  • 更新:2020-07-09 18:49
  • 阅读:583

#插件讨论# 【 httpserver - ican 】post如何接收

分类:uni-app

你好,请教一下,我在APP上起了httpServer
代码如下:

    export default {  
        data() {  
            return {  
                title: 'Hello',  
                hs: false,  
            }  
        },  
        onLoad() {  
            this.hs = uni.requireNativePlugin('YPL-httpserver');  
            this.hs.startServer({host:'192.168.0.58', port:9876},res => {  
                // 回调结果  
                console.log(res)  
            });  
            root:plus.io.convertLocalFileSystemURL("_www")  
            console.log(plus.io.convertLocalFileSystemURL("_www"))  
        },  
        onUnload() {  
            this.hs.stopServer();  
        },  
        methods: {  

        } // end of methods  
    }

打印结果如下:

15:43:14.603 应用【httpServerDemo】已启动...  
15:43:15.129 App Launch at App.vue:4  
15:43:15.154 App Show at App.vue:7  
15:43:15.832 /storage/emulated/0/Android/data/uni.UNI3B0E10C/apps/__UNI__3B0E10C/www/ at pages/index/index.vue:25  
15:43:15.855 [Object] {"start":true,"httpServer":{}}  at pages/index/index.vue:22

现在我要接收POST数据,要怎么弄?

2020-07-09 15:47 负责人:无 分享
已邀请:
ican

ican - 全栈开发

你好,目前插件提供静态网站的访问,对于在js中处理服务器请求的需要,下个版本增加

该问题目前已经被锁定, 无法添加新回复