Hi there,
I am running into problems with my server communication.
My network.request command runs without any problem in the simulator and even returns a response
in the networkListener.
The response shows that the simple string I sent to the server should be in the array server-side, but after checking, the array is empty.
My question now is why do I get a positive response from my networkListener, when there is no data in the array. How does the PHP script need to look like?
[lua]
– NETWORK
local function networkListener(event)
if ( event.isError ) then
print( “Network error!” )
else
print( "RESPONSE: "…event.response )
end
end
local function sendToServer()
local headers = {}
headers[“Content-Type”] = “application/x-www-form-urlencoded”
headers[“Accept-Language”] = “en-US”
local params = {}
params.headers = headers
params.body = “message=hey”
network.request( “http://exampleURL”, “POST”, networkListener, params)
end
[/lua]