hello
i�m trying to connect to a
servlet using a midlet using the next code :
try {
c = (HttpConnection)Connector.open(url);
c.setRequestMethod(HttpConnection.POST);
c.setRequestProperty("IF-Modified-Since","11 May 2005 15:17:19 GMT");
c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
c.setRequestProperty("Content-Languaje","en-CA");
c.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
os = c.openOutputStream();
os.write( ("nombre="+myname).getBytes() );
os.flush();
is=c.openDataInputStream();
int ch;
while( (ch = is.read()) != -1){
b.append( (char) ch );
System.out.print( (char) ch );
}
t= new TextBox("fecha", b.toString(),1024,0 );
t.setCommandListener(this);
} finally {
if(is !=null){
is.close();
}
if( os != null){
os.close();
}
if ( c !=null){
c.close();
}
now im using the netbeans 4.0
ide for
test my code and this is
the message displayed : It is ok to use airtime ?
Apreciatelly Mark could u give me some tip for finalize my homework ?
regards