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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how to get the POST message?" Watch "how to get the POST message?" New topic
Author

how to get the POST message?

yoga nandiwardhana
Greenhorn

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

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


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: http://aspose.com/file-tools
 
subject: how to get the POST message?