Thursday, October 13, 2011

Http request with telnet

How to do http request with telnet command: for testing www server or other reasons.
it's very simple, fo example


# telnet www.server.com 80GET / HTTP/1.0
 

don't forget twice  press enter (new line) after type "GET / HTTP/1.0"


or you can use HTTP 1.1 protocol,
# telnet www.server.com 80GET / HTTP/1.1
Host: www.server.com
 


or if you want to see only http-headers in response type HEAD instend of GET

# telnet www.server.com 80HEAD / HTTP/1.1
Host: www.server.com
 

also you can define other argument with HTTP 1.1 protocol, for example Referer, User-Agetn etc

No comments: