aspose file tools*
The moose likes Servlets and the fly likes Where can I find 'POST' Request String? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where can I find Watch "Where can I find New topic
Author

Where can I find 'POST' Request String?

stevens liu
Greenhorn

Joined: Sep 11, 2001
Posts: 4
I can find the request string of 'GET' by 'getQueryString()' method of httpRequest class, but where can find it of 'POST'?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
request.getParameter("yourparameter")

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
request.getParameter("yourparameter")

Bosun
stevens liu
Greenhorn

Joined: Sep 11, 2001
Posts: 4
thanks for reply!
I want to get the whole request string of 'POST', not a parameter of it,can you give me another advice? thank you in advance.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
I am not even sure if that can be done for POST. You may just have to use GET as the "action" of your form. getQueryString() is available only for a GET request.

Bosun
shilpa kulkarni
Ranch Hand

Joined: Jun 07, 2000
Posts: 87
I agree with Bosun, when you POST there is no 'QueryString'.
Query String is that part of the http request which follows the servlet/jsp path and the '?'. In case of POST there is not such string.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
You can get the entire POSTed raw data as a binary InputStream by calling the getInputStream method in the ServletRequest interface, or as a BufferedReader by calling getReader.
I think you may have to do this without calling any of the getParameter methods, but try it and see.
Bill
------------------
author of:
stevens liu
Greenhorn

Joined: Sep 11, 2001
Posts: 4
It's working now! thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Where can I find 'POST' Request String?