File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Anatomy of an HTTP POST request

 
Mukesh Bhojwani
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The request's "getProtocol" method tells you #1.

For #2, use the requests's getReader methods.
 
Mukesh Bhojwani
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You very very much.

I tried it, it worked absolutely funtastic!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic