Post Requests work on IOS but not Android

The code below works great in IOS but just returns network Error when testing on an Android device. I have the latest build - CoronaSDK 2013.1171 -.

 

My  build settings contain:

            “android.permission.INTERNET”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

            “android.permission.ACCESS_FINE_LOCATION”,

            “android.permission.ACCESS_COURSE_LOCATION”,

 

Any ideas?

Thanks


 

local function networkListenerLamp( event )

        if ( event.isError ) then

               print( “Network error!”)

              native.showAlert( “Network Error!”, “Status: Try Again.”, { “OK” } )

        else

                print ( "RESPONSE: " … event.response )

                   end

               end


 

local function LampHttp()

 

 colortype ="#000000"

 


headers = {}

headers[“Content-Type”] = “application/json”

headers[“Accept-Language”] = “en-US”

body = ‘{“program”: "’ … programtype … ‘",“color”: "’ … colortype … ‘"}’ 

 

–*******************************

local params = {}

params.headers = headers

params.body = body

 

– **Note _G.Account and URL are not real but the format is exactly like the one not working

 

network.request( “https://agent.electric.com/”…_G.Accountt , “POST”, networkListenerLamp,  params)

 

end

 

What error?

In networkListenerLamp there is always an event.isError. I might point out that the server that I call is returning a JSON string which i do not process here.

Got it to work! Ask the server to specify in their header what the Content-Type was. 

If you are getting .isError is true then either the server is timing out or it doesn’t exist.  If the requested file doesn’t exist, you will get a successful return but with a 404 status code. 

Can you post the actual URL you’re trying to hit?   Also do you mean to have two “t”'s on the end of _G.Accountt?

What error?

In networkListenerLamp there is always an event.isError. I might point out that the server that I call is returning a JSON string which i do not process here.

Got it to work! Ask the server to specify in their header what the Content-Type was. 

If you are getting .isError is true then either the server is timing out or it doesn’t exist.  If the requested file doesn’t exist, you will get a successful return but with a 404 status code. 

Can you post the actual URL you’re trying to hit?   Also do you mean to have two “t”'s on the end of _G.Accountt?