http.request

5 replies [Last post]
shuri
User offline. Last seen 1 year 50 weeks ago. Offline
Joined: 29 Jul 2009

Hi all,
if the http.request works with wifi all works fine, if it works in grps mode and no connection is active I have an error and nothing works. If there is a connection active (for example mail) all works fine also in gprs mode.

There is a solution that i don't know?

Thanks
Alessandro

Replies

carlos m. icaza's picture
carlos m. icaza
User offline. Last seen 13 hours 21 min ago. Offline
Ansca Staff
Joined: 22 Jun 2009

can you provide sample code that is giving you problem?

Carlos

shuri
User offline. Last seen 1 year 50 weeks ago. Offline
Joined: 29 Jul 2009

Of course.
This happens only on the device, in the simulator always all ok

...

function init()
native.setActivityIndicator( true )
b, c, h = http.request( "http://www.xxx.net/file.xml" )
if (c == 200) then
--
else
local splashscreen = display.newImage( "splashscreen.png" )
myText = display.newText( "No internet connection", 10, 420, "Helvetica-Bold", 18 )
myText:setTextColor( 255, 255, 255 )
end
native.setActivityIndicator( false )
end
...

init()

pmaxim
User offline. Last seen 2 days 3 hours ago. Offline
Joined: 25 Aug 2009

Confirm the problem.
I have to run any application that requires internet connection before that I could run any corona application that uses lua http socket (when there is not wifi connection).

evank
User offline. Last seen 1 year 4 weeks ago. Offline
Joined: 16 Sep 2009

Logged as a bug, testing now...

seanh
User offline. Last seen 16 hours 34 min ago. Offline
Ansca Staff
Joined: 3 Jun 2009

(Logged as bug #138)

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.