Python code for hitting a URL
Nov. 17th, 2003 | 05:44 pm
mood:
impressed
Here's Python code (tested with Python 2.2) for hitting a URL:
---- 8< ----
---- >8 ----
Put this in a
More
---- 8< ----
from httplib import *
conn = HTTPConnection("incq210bc.idc.oracle.com:8 888")
conn.request("GET", "/")
resp = conn.getresponse()
print resp.status, resp.reason
data = resp.read()
conn.close()---- >8 ----
Put this in a
for loop if you want to hit it repeatedly. I wrote this in 2 mins. ;-) for testing my servlet. Python is cool.More
httplib examples on Python.org.