Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

httpclient: responseText it shorted (cutted)

$
0
0

Hi, on Android (2.3) I have an issue with http client.

XenoCanto.prototype.testLogin = function(_args) {
    var xhr = Ti.Network.createHTTPClient({
        onload : function() {
            var res = /<header>(.*?)<\/header>/gi.exec(this.responseText);
            console.log(res);  // is null, where in web is this snippet
        },
        onerror : function() {
            console.log(this.error);
        }
    });
    xhr.open('GET', 'http://www.xeno-canto.org/index.php';);
    xhr.setRequestHeader('Cookie', this.login);
    xhr.send(null);
}
'this.login' I got from an older http request.

If I call this URL in standard browser, then the I see ca. 27.6 kB. 'this.responseText.length' says me 51.4 kB and if I write this on console I have 3.7 kB. The responseText is cutted and I cannot match the <header> stuff.

Here the responseHeader:

Server:Apache/2.2.3 (CentOS)
X-Powered-By:PHP/5.3.17
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma:no-cache
X-Powered-By:PleskLin
Vary:Accept-Encoding
Keep-Alive:timeout=5, max=1498
Connection:Keep-Alive
Transfer-Encoding:chunked
Content-Type:text/html
Any ideas, what is with 'chunked' - transfer-encoding?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>