This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending request headers manually

 
Bachi Taurean
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I understand that when a resource on the webserver is requested, the browser sends the request headers and initiates a request to the web server. I wanted to know if we can trigger a GET or POST request manually to a servlet.(Not through browser or any other means).Please let me know if there is a possibility.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use telnet for this.Establish a TCP connection with your server (and the correct port)and then use GET to fetch page , You can pass parameters using query string appending to the URL.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The commands for this would be:

to start Telnet (replace the server name and port as appropriate), and then

and hit return twice. That should print out the start page, and then close the connection.
 
Bachi Taurean
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rahul,

Thanks for the reply. I did the following to use telnet. Please correct me if I am missing something

(1)Opened telnet client from Start->Run->Telnet from windows.
(2)Tried connecting to Tomcat server on the same machine as follows
(i)telnet 172.24.17.22 8080. This showed me blank window
(ii)telnet and then at the telnet prompt issued telnet command "o 172.24.17.22 8080". This said connecting to 172.24.... and then showed me a blank window.

I also tried replacing my machine IP address above by "localhost" and
"md-bhaskar"(my machine hostname) but in vain. Please let me know if I need to do anything further.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is all good and expected.

Did you try what ULF suggested ?

Once a successful connection is established , you will get a blank screen as you are getting now.

Paste the following code to get the home page of ROOT application of Tomcat.

 
Bachi Taurean
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Rahul and Ulf, it is working now.Appreciate your immediate reply and help
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic