This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Anatomy of an HTTP POST request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Anatomy of an HTTP POST request" Watch "Anatomy of an HTTP POST request" New topic
Author

Anatomy of an HTTP POST request

Mukesh Bhojwani
Greenhorn

Joined: Mar 11, 2008
Posts: 25
I want to print the following POST request details by the servlet



I use the following code in my servlet.

Of the intended details I am unable to print the following two details:

1) 'The protocol version that the web browser is requesting' as shown in the intended output's first line HTTP/1.1.
2) The message body or payload as shown in the intended output's last line color-dark&taste-malty

Please help me out as to which methods I need to use to get the above two details.


SCJP 5 with 94%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
The request's "getProtocol" method tells you #1.

For #2, use the requests's getReader methods.


Ping & DNS - my free Android networking tools app
Mukesh Bhojwani
Greenhorn

Joined: Mar 11, 2008
Posts: 25
Thank You very very much.

I tried it, it worked absolutely funtastic!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anatomy of an HTTP POST request