wood burning stoves*
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
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: 41108
    
  45
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!!!
 
 
subject: Anatomy of an HTTP POST request
 
Similar Threads
HttpUrlConnection: Login works only for first page
problem setting custom header in response
glassfish auto-generates unwanted session
How to See the HTTP Message Exchange between browser and Tomcat?
Cannot find child element: arg0