I'm writing a game that that can transmit a high score to a
servlet running in
Tomcat. But I can't seem to figure out how to get the midlet to transmit a parameter using the post method.
I have a simple html form set up to
test the server which sends two params by POST, the first called 'action' and the second called 'payload'. (The servlet uses it's request.getParameter("action") or ("payload") in it's doPost() to retrieve the parameters). This works fine, but how can I send params from midlet in a way similar to the html form?
I've tried writing 'myHttpConnection.setRequestProperty("action", "some-action")' in the midlet and then 'myOutputStream.flush()' when I've set properties, but the server doesn't seem to be getting anything.
I've also tried setting the content-length property to "x-www-form-urlencoded" but still no joy
Anyone have any ideas about how I should be sending params via post?
[ April 10, 2005: Message edited by: Gar Morley ]