This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java httpclient print HTTP Headers  RSS feed

 
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: 42972
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!