httpclient broken for 1.5.0 > githash=1dd0106
CORRECTION githash=3ee6a97
Hi
What's going on with the httpClient?
The version with githash=3ee6a97 is the last working fine, all that are above this breaks httpclient trying to parse a html code as xml.
Of course this breaks the yql too.
Any ideas?
8 Answers
-
Hey tamas, you should provide some code of a working example on a previous version to understand what you want to do. I actually did some html parsing last night and might be able to help
-
Nothing special, just plain httpclient.
I keep getting this error[ERROR] Error Domain=com.google.GDataXML Code=-1 "The operation couldn’t be completed. (com.google.GDataXML error -1.)". in -[TiDOMDocumentProxy parseString:] (TiDOMDocumentProxy.m:50)
Then a lot of xmlparser complains.
What build do you use?
-
This is what I did. Since you are trying to parse as an XML, single tags like <img /> will give errors. What I did was look at the code and find which tags I didn't need and which tgs where "single" tags. Then grab the text from the HTML and do a "find and replace" to remove all the possible XML errors leaving only the stuff I needed and making sure that every opening tag had a closing tag, for example, <p></p> or <a></a>. Make sense?
Removing the image tags:var findImg = new RegExp("<img([^<>+]*)[^\/]>", "g"); theStuffThatIWant = theStuffThatIWant.replace(findImg, "");
-
I'm not trying to parse anything.
I just go to an url that has a redirect.
I need to get the redirect location. The old version plays nice and populate the location property correctly. The new versions are simply crashing with the error I wrote previously. -
Some update:
On of the last commits fixes somehow the responseXML issue, except the location problem I'm facing.
digging into the source I found a release_to_nil that when commented it returns the location correctly.
Here is more infohttp://bit.ly/gSa086
-
I got same error with 1.5.0 4d92d40
Here is my code.var url = 'http://maps.google.com/maps/api/geocode/json?address=kansas&sensor=true'; var xhr = Titanium.Network.createHTTPClient(); xhr.open( 'GET', url ); xhr.onload = function() { var json = eval( '(' + xhr.responseText + ')' ); }; xhr.send();
This code try to access google maps api and get Kansas gps position.
It works with 1.4.2 and 1.2.0 but it doesnot works with 1.5.0. -
Try the latest build, and if yo need location try the fix I posted on LH http://bit.ly/gSa086
-
I find this is still broken with the GA release of 1.5