Hi,
If you run this snippet from an Android device (Tested in Galaxy S2, S3 and S4):
[lua]
local function networkListener( event )
if ( event.isError ) then
print( “Network error!”)
else
print ( "RESPONSE: " … event.response )
end
end
local headers = {}
headers[“Content-Type”] = “application/x-www-form-urlencoded”
headers[“Accept-Language”] = “en-US”
local body = “name=جحخه”
local params = {}
params.headers = headers
params.body = body
network.request( “http://66.96.147.105”, “POST”, networkListener, params)
[/lua]
You will get the ERROR shown below displayed on the terminal (I use this command to print the logs: adb logcat Corona:v*:S):
I/System.out(23994): ERROR: expected 9 bytes but received 13
But if you run the same snippet from an iPhone device, it works fine an it displays a proper response:
RESPONSE: <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don’t have permission to access /
on this server.</p>
</body></html>
Can you please advice?
Thanks,