This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending request headers manually

 
Bachi Taurean
Greenhorn
Posts: 26
  • 0
  • 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
  • 0
  • 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: 42966
73
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic