Send HTTP packets without a browser?

I have two questions:

  • I am trying to send an HTTP request to a web server without using a web browser. I read that the most common way to do this is with Telnet, but I wondered about other ways.

  • Also, I think my telnet has a problem. I activated the telnet client and went to the command window and dialed telnet, then dialed β€œopen IP address 80” and it says β€œconnect to IP address ...” forever, but never lets me get past this. Have any of you encountered this problem? In addition, I noticed in Wireshark that the TCP handshake is happening correctly.

Please thanks!

+4
source share
3 answers

You should also check out the curl command-line utility: http://curl.haxx.se/ Basically, this is a cool little piece of software that handles HTTP requests (and also supports other protocols). Also check out hurl: http://www.hurl.it/ , which is a kind of web application freeze version.

+2
source

Did you specify the port? Port 80 is commonly used for HTTP requests.

telnet www.some-site.com/some-page.html 80

Once you are connected, you need to make a GET request. (Send a GET command).

0
source

You can accomplish the same thing using sockets or WebClient (C #):

By default, Telnet used:

At the telnet command line, you can do:

  o host port> (o www.website.com 80) GET /index.htm HTTP/1.1 

Using WebClient (Note: this is a WebClient C # object):

  var webClient = new WebClient(); webClient.Headers.Add("user-agent", "Agent"); Stream responseStream = webClient.OpenRead("http://www.google.com") 

The response from the server will be stored inside the responseStream object.

0
source

All Articles