Yes, but I think you will want to look at the setRequestProperty(String key, String value) method. Remember that even though you are on J2ME, the methods that you need to set content, heard, etc information in your Request object is available.
I couldn't recuperate the values of parameters side server. The value worth null side server. param1=null etc... ... .. conn = ( HttpConnection )Connector.open( "http://myserver.com",Connector.READ_WRITE ); conn.setRequestMethod(HttpConnection.GET); conn.setRequestProperty("param1","1"); conn.setRequestProperty("param2","2"); conn.setRequestProperty("param3","3"); ... ....
- If you want to set a query string with GET you should specify it in the URL . For example: HttpConnection c = (HttpConnection)Connector.open("http://host.com?a=1&b=2");
- To use the connection's ouput stream the request type has to be set to POST. c.setRequestType(HttpConnection.POST); OutputStream os = c.openOutputStream(); os.write(what_you_want); os.close();
- setRequestProperty() methods sets information in the HTTP protocol request header - this is not very good to pass data parameters and may be misunderstood by the HTTP server.
Also, depending on which method you use the interface at the other end is different.