Problem Rho::AsyncHttp.get

When did the migration from 2.2.13 to Rhodes Rhodes 4.0.0 Rho :: AsyncHttp.get function stopped working;

result = Rho::AsyncHttp.get(:url => url)

$iCodCity = result['body'].first['cd_cidade']

$sCity = result['body'].first['ds_municipio']

My:

result    "{\\"ds_uf\\":\\"SC\\",\\"ds_municipio\\":\\"Florian\\xC3\\xB3polis\\",\\"cd_munic\\":\\"4205407\\"}"   

Adel Sari
use Rho::Network api instead

use Rho::Network api instead

Rhomobile | Network

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
Hello Adel,I swapped stop api

Hello Adel,

I swapped stop api as you indicated more still giving the same problem:

result = Rho :: Network.get (: url => url) ['body']

iCodCity = $ result ["cd_munic"]

SUF = $ result ["ds_uf"]

Scity = $ result ["ds_municipio"]

My result: "{\\"ds_uf\\":\\"SC\\",\\"ds_municipio\\":\\"Florian\\xC3\\xB3polis\\",\\"cd_munic\\":\\"4205407\\"}"

The $ iCodCity is coming: cd_munic for: 4205407

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Adel Sari
use Rho::JSON.parse to parse

use Rho::JSON.parse to parse your result data.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
Thanks Adel,Did the way you

Thanks Adel,

Did the way you said and it worked perfectly.

result = Rho :: JSON.parse (Rho :: AsyncHttp.get (: url => url) ['body'])

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
I know question's been

I know question's been answered, but just to confirm. Would Rho::Network work on WP? Anyone's tested it?

If not then this needs to be changed : Rhomobile | RhoMobile API Summary

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
Hi Mark, tested with both API

Hi Mark, tested with both API in Apple and Android:

Rho :: AsyncHttp.get (: url => url) ['body']

Rho :: Network.get (: url => url) ['body'])

Both worked perfectly.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
That's good news. Have you

That's good news. Have you tested with 2.2 (I believe its using the old Rho::AsyncHTTP API)?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
Yes with 2.2 we were only


Yes with 2.2 we were only using the old API:

Rho :: AsyncHttp.get (: url => url) ['body']

Tested on both 4.0 APIs:

Rho :: AsyncHttp.get (: url => url) ['body']
Rho :: Network.get (: url => url) ['body'])

We were happy we were able to maintain compatibility.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Whoa, Hold your horses, this

Whoa, Hold your horses, this was what I got thru email :

Hi Mark, tested with both API in WP8:

Rho :: AsyncHttp.get (: url => url)

Rho :: Network.get (: url => url) )

Both worked perfectly.

I thought you mentioned about WP, not Apple or Android. Strange, but your posts seem to have been edited after the email was sent by Jive

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
I'm sorry is that I had to

I'm sorry is that I had to edit my own comment so I had sent him the message

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Hmm. Looks like there's a

Hmm. Looks like there's a problem with Jive...

Ok, so just to confirm : you haven't tested on Windows Phone, have you?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Fernando Coelho...
I have not tested on windows

I have not tested on windows phone.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Ok, let's see if others have.

Ok, let's see if others have. Thanks

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments