Hi,
I’ve a problem with sending params via HTTP POST. In my app I have to send 2 params: “hash” and content of textField. When I try to send the params I get error information saying that text is a nil value. I tried create variable e.g. “local pole = txtFirstName.text”, but it isn’t working too.
I paste the most importatne parts of my code:
local imei = system.getInfo( "deviceID" ) local hashe = crypto.digest( crypto.md5, imei ) if imei then print(hashe) end txtFirstName = native.newTextField( 237, 170,400, 130 ) txtFirstName.size = 30 txtFirstName:addEventListener( "userInput", txtFirstName ) local params = {} params.body = "tresc="..txtFirstName.text.."&hash=hashe" local function networkListener( event ) if ( event.isError ) then print( "Network error!") else print ( "RESPONSE: " .. event.response ) end end function wysylanie (event) if event.phase == "began" then storyboard.gotoScene("udano", "fade", 500) network.request( "localhost/send.php", "POST", networkListener, params) end end
Thanks a lot for help