Hi
I searched the web and I spent a lot of time to solve this ,but I can't find any solution. My phone is 3650 version 2,50 ...
Thanks.......
Hi
I searched the web and I spent a lot of time to solve this ,but I can't find any solution. My phone is 3650 version 2,50 ...
Thanks.......
Hi You wanted to post some data isn't it..
you can do something like this
try{
HttpConnection hConn = (HttpConnection) Connector.open(url);
//set the connection to be closed once the transaction is complete
hConn.setRequestProperty("Connection","close");
//Get input stream
InputStream is = hConn.openInputStream();
int ch = 0;
while(ch != -1)
{
ch = is.read();
}
//Output
OuputStream os = hConn.openOutputStream();
byte[] data = String("HI").getBytes();
os.write(data,0,data.length);
//close alll streams
is.close();
os.close();
hConn.close();
}
catch(Exception e)
{
System.out.println("Handle this exception");
}
I hope u wanted some thing like this..
Very very thanks for your reply abhiauradkar,
I tried it but i can't do it again .Iwill give much information;
My midlet works on other phone .It dosn't run on real 3650 and s60 emulator.In this forum many people has a problem like this,some of them found a solution.I tried a lot of different combinations to post some data to a java server page but i couldn't.
I want to post some data like this;
name=ahmet&surname=hasan&age=50
Cumhur
Just add it to the end of the url string and open up the browser. That will post the data.
Just add it to the end of the url string and open up the browser. That will post the data.
No, it does a http1.0 GET.
@cumhur: so why do you need the POST anyway? You'll only need it if you want to transfer more than 1KB to your server... Perhaps a GET will do for you as well indeed?
I don't want to use my server ,I want to use it like a mini web browser.maybe one program for one site .and then another program for another web site.
When I add it to the end of the url string ; and I add this line :
c.setRequestMethod(HttpConnection.POST);
It works BUT again only normal phones not in s60 emulator.
What is the s60's problem?? Why it dosn't %100 compatible with j2me??
And I need example code of http post (fully,from the begining) which can run on s60.
I need your helps ,Thanks..