Hi,
i'm testing a game on a nokia 6021. I have a Http connection on wich i try to do a POST (i tried also with a GET but same result) and on connection (respCode = c.getResponseCode(); ) i receive an "Error on HTTP connection"
The same code works fine on a Nokia N70 and on every emulator i tested (Series 40 emulator, Series 60 emulator, Sony Ericsson, Motorola). I would think this is a bug for this device ... or i just don't do the connection correct.
The address i'm connecting to is : http://test.test.com:8080/Web/Servlet
The servlet is on a Tomcat
The logs shows that Tomcat does not receive any request from client.
I don't understand what is wrong here... my code ... the jvm on 6021 ...if it's a bug in jvm , is there a workaround for this ?
Thanks,
Mircea
The code is :
Code:HttpConnection c = (HttpConnection)Connector.open(url); c.setRequestMethod(HttpConnection.POST); byte[] ba = reqData.getBytes(); c.setRequestProperty("content-type","application/x-www-form-urlencoded"); c.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1"); OutputStream os = c.openOutputStream(); os.write(ba); //os.flush(); os.close(); int respCode = c.getResponseCode(); if(respCode == HttpConnection.HTTP_OK) { //some code }

Reply With Quote


