aspose file tools
The moose likes Java Micro Edition and the fly likes how to get the POST message? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how to get the POST message?" Watch "how to get the POST message?" New topic

how to get the POST message?

yoga nandiwardhana

Joined: Mar 18, 2003
Posts: 8
i sent an http post with a message body from a midlet to a servlet. what is the easiest way to read the body on the servlet? i tried using inputstreams and then is.readLine and tried to append them to a stringbuffer but it didn't work. help please..
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17260

Have you tried using a Reader in the request method getReader() returns a BufferedReader to read the Body of the request Object.

Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
a sanjuan
Ranch Hand

Joined: Jun 12, 2002
Posts: 164
i'm confused here....what do you mean by message body, and reading from a servlet? are you sending binary data to the servlet?
httpservlets have a defined structure....if you are sending data using a POST method, then the doPost method can be used to parse out the data using request.getParameter("nameofvalue")....if you are sending multi-part data, then it's a bit more tricky, but i also doable (e.g. if you are uploading a file to the servlet).
I agree. Here's the link:
subject: how to get the POST message?