Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Fetch url

Hello.

I wonder if anyone knows how to fetch a webpage source code? Is it possible with GET?

— asked July 28th 2010 by Adam Folkesson
  • code
  • fetch
  • get
  • save
  • source
  • url
  • webpage
0 Comments

3 Answers

  • Accepted Answer

    try this:

    
    
    
    var xhr = Titanium.Network.createHTTPClient();
    xhr.onload = function()
    {
    
        sourcecode = this.responseText;
    
    Titanium.API.info(sourcecode);
    
    };
    
    xhr.open("GET","http://google.com");
    xhr.send();
    
    — answered July 28th 2010 by Dan Tamas
    permalink
    0 Comments
  • try HttpClient

    — answered July 28th 2010 by Dan Tamas
    permalink
    0 Comments
  • Tamas Daniel:

    I've allready tried a few methodes and properties in HttpClient. But I can't get it to work.

    — answered July 28th 2010 by Adam Folkesson
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.