fetch和http无法获取完整的文件。nativescript iOS

fetch和http无法获取完整的文件。nativescript iOS,nativescript,Nativescript,Nativescript有两个函数用于获取http请求或http函数。我使用这两个函数获取IOS站点的字符串(用html响应) 问题是它返回了部分响应,但没有返回IOS的所有响应。这意味着它只返回http请求的一半文件 例如: http.getString("https://slashdot.org").then(function (html) { console.log(html) }), function (error) { console.log("

Nativescript有两个函数用于获取http请求或http函数。我使用这两个函数获取IOS站点的字符串(用html响应)

问题是它返回了部分响应,但没有返回IOS的所有响应。这意味着它只返回http请求的一半文件

例如:

http.getString("https://slashdot.org").then(function (html) {
        console.log(html)
    }), function (error) {
        console.log("Error: " + error)
    }
返回部分响应(html),但随后停止:

  var e = document.createElement('script');
        e.type = 'text/javascript';
        e.id = 'janrainAuthWidget';
        if (doc
这些是响应返回“if(doc)”之前的最后一行。最后一行应该是。因此http(我也尝试过获取)不会返回整个文件

我需要得到整个文件的响应,以便我的项目能够正常工作


我需要做什么才能使http或fetch工作?是否有一些隐藏的超时被激活。或者我应该使用CocoaPods,如果我应该如何使用CocoaPods?

我身边的代码正在返回整个HTML内容

重定向页面的结果

    JS: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    JS: <html><head>
    JS: <title>302 Found</title>
    JS: </head><body>
    JS: <h1>Found</h1>
    JS: <p>The document has moved <a href="http://m.slashdot.org">here</a>.</p>
    JS: </body></html>
JS:
JS:
找到了JS:302
JS:
JS:找到了
JS:文档已移动

JS:
即使是重定向链接也会返回所需的所有HTML,因此我想这可能是本地设置或连接的问题

JS:     $(document).ready(function () {
JS:         function checkCloseAd(){
JS:             var adon = $('div.ad-on');
JS:             if(adon){
JS:                 var closead = adon.find('.close-ad');
JS:                 if(!closead || closead.length === 0){
JS:                     adon.prepend('<div class="close-ad"><span>Close Ad</span></div>');
JS:                 }
JS:             }
JS:         }
JS:         function footerFixer(){
JS:             var footer = $('#home .stage-center #footer');
JS:             if(footer.length){
JS:                 if(footer.length > 1){
JS:                     $('#home .stage-center #footer').eq(1).remove();
JS:                 }
JS:                 if(footerHtml != $(footer).html()) footerHtml = $(footer).html();
JS:             }else{
JS:                 $('#home .stage-center div').first().append('<div id="footer">'+footerHtml+'</div>');
JS:             }
JS:         }
JS:         $('#river_bottom').prepend('<div class="close-ad"><span>Close Ad</span></div>');
JS:         $('body').on('click','.close-ad', function(){
JS:             $(this).hide();
JS:             $('#river_bottom,#story_slot2').toggleClass('ad-on');
JS:         });
JS:         setInterval(checkCloseAd,1000);
JS:         setInterval(footerFixer,1000);
JS:     });
JS: </script>
JS:
JS: </body>
JS: </html>
JS:$(文档).ready(函数(){
JS:checkCloseAd()函数{
JS:var-adon=$('div.ad-on');
JS:if(adon){
JS:var closead=adon.find('.closead');
JS:if(!closead | | closead.length==0){
JS:adon.prepend('closead');
JS:}
JS:}
JS:}
JS:footerFixer()函数{
JS:var footer=$(“#home.stage center#footer”);
JS:if(页脚长度){
JS:if(footer.length>1){
JS:$('#home.stage center#footer').eq(1).remove();
JS:}
JS:if(footerHtml!=$(footer.html())footerHtml=$(footer.html();
JS:}其他{
JS:$('#home.stage center div').first().append(''+footerHtml+'');
JS:}
JS:}
JS:$('river#u bottom')。前置('Close Ad');
JS:$('body')。在('click','上。关闭ad',函数(){
JS:$(this.hide();
JS:$('river#u bottom,'story#u slot2')。toggleClass('ad-on');
JS:});
JS:setInterval(checkCloseAd,1000);
JS:setInterval(footerFixer,1000);
JS:});
JS:
JS:
JS:
JS:

对不起,我应该更具体地说明我的构建。我在IOS上遇到了这个错误。不是android,我在android版本上也遇到了一个小问题,但我可以通过设置http函数的超时参数来解决。但是这仍然不能解决IOS的问题。