-
Notifications
You must be signed in to change notification settings - Fork 148
Identify web server
rollynoel edited this page Jun 13, 2013
·
2 revisions
Added by Rodrigo B. de Oliveira
import System.Net
using response=WebRequest.Create("http://www.orkut.com").GetResponse():
print(response.Headers["Server"])
If you are behind a non-transparent firewall/proxy you may need to set the proxy credentials so the example would change a bit:
import System.Net
request = WebRequest.Create("http://www.orkut.com")
proxy = WebProxy.GetDefaultProxy()
proxy.Credentials = NetworkCredential("username", "password")
request.Proxy = proxy
using response=request.GetResponse():
print(response.Headers["Server"])