Skip to content

Instantly share code, notes, and snippets.

@afandian
Created January 20, 2011 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afandian/788658 to your computer and use it in GitHub Desktop.
Save afandian/788658 to your computer and use it in GitHub Desktop.
testclient.py
import httplib
ip = "127.0.0.1"
conn = httplib.HTTPConnection("localhost", 10000) # address and port of server
conn.request("GET", "/ping/%s/"%ip)
response = conn.getresponse()
pingOk = False
if response.status == 200:
responsecontent = response.read()
if responsecontent == "ok":
pingOk = True
conn.close()
print pingOk
@afandian
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment