j2me Http Post problems with IIS 6.0
Hi,
I have developed a system where a j2me midlet sends some post data to a php page running under IIS.
The system works fine under IIS 5.x but get a errorcode 400 on IIS 6.0
Any idea please ?
I think some special settings in IIS 6.0 is responsible for this.
If you are interested , the j2me sender is doing the followings :
http = (HttpConnection) Connector.open(URL);
String agent = "Profile/MIDP-2.0, Configuration/CLDC-1.1";
String rawData = "orders="+codes+"&cust="+cust_code.getString()+"&mob="+mobileNo;
rawData+="&dist_cd="+dist_code.getString()+"&thana_cd="+thana_code.getString()+"&union_cd="+union_code.getString()+"&sale_type="+sales_type.getString();
String type = "application/x-www-form-urlencoded";
// set the request method as POST
http.setRequestMethod(HttpConnection.POST);
http.setRequestProperty( "User-Agent", agent );
http.setRequestProperty( "Content-Type", type );
http.setRequestProperty("Content-Language","en-US");
http.setRequestProperty( "Content-Length", Integer.toString(rawData.length()));
OutputStream os = http.openOutputStream();
os.write( rawData.getBytes() );
//http.setRequestMethod(HttpConnection.GET);
// server response
int i;
if ((i=http.getResponseCode()) == HttpConnection.HTTP_OK)
{
sb = new StringBuffer();
int ch;
is = http.openInputStream();
while ((ch = is.read()) != -1)
sb.append((char) ch);
reply=sb.toString();
}
-
Please help :(
Thanks in advance.
Mahmudul Alam Dipu

