Posted By:
Ravi_G
Posted On:
Wednesday, July 10, 2002 02:49 AM
I am using the following code to send the data from a MIDlet c = (HttpConnection)Connector.open("http://localhost/register.asp"); c.setRequestMethod(HttpConnection.POST); c.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT"); c.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0"); c.setRequestProperty("Content-Language", "en-CA"); c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); os = c.openOutputStream(); String str = "name="+tfName.getString()+"&pwd="+tfPwd.getString(); byte postmsg[] = str.getB
More>>
I am using the following code to send the data from a MIDlet
c = (HttpConnection)Connector.open("http://localhost/register.asp");
c.setRequestMethod(HttpConnection.POST);
c.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT");
c.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
c.setRequestProperty("Content-Language", "en-CA");
c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
os = c.openOutputStream();
String str = "name="+tfName.getString()+"&pwd="+tfPwd.getString();
byte postmsg[] = str.getBytes();
for(int i=0;i
{
os.write(postmsg[i]);
}
os.close();
When I have entered name as 'ravi test name' at the server the name is retrieved as 'ravitestname'.
What is the solution for this. Can anybody please give me a solution. Thanks
<<Less