首页 > 其他分享 >ELECTRON 发起 网络请求

ELECTRON 发起 网络请求

时间:2022-09-01 15:35:02浏览次数:58  
标签:console 请求 发起 chunk request ELECTRON response log

(function () {
            let request = ELECTRON.remote.net.request('URL what you want');
            request.on('response', function (response) {
                
                console.log(response.statusCode);
                console.log(response.headers);
                response.on('data', function (chunk) {
                    //chunk.toString()是响应内容
                    console.log(chunk.toString());
                });
            });
            request.end();//这句一定要有
 
        })();

标签:console,请求,发起,chunk,request,ELECTRON,response,log
From: https://www.cnblogs.com/wkk2020/p/16646687.html

相关文章