• Post Reply Bookmark Topic Watch Topic
  • New Topic

java httpclient print HTTP Headers

 
tech king
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI all,
i am using HTTP Client to send basic HTTP ( GET POST PUT DELETE) Requests to webserver.
But sometimes i make mistake in passing the request correctly. Hence i decided to print the HTTP Request HEADERS before sending the request to the webserver.
I do not know how to print the request HTTP headers. I also referred " http://hc.apache.org/httpclient-3.x/tutorial.html " tutorial, but could not find anything.
So has anyone written such a code
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The org.apache.commons.httpclient.HttpMethod interface -which is implemented by GetMethod, PostMethod, etc.- has several methods that let you examine the request headers.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!