Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3bbb85f9da
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (36 sloc) 1.085 kb
import httplib
def get(host, path, port = 80):
con = httplib.HTTPConnection(host, port)
con.request('GET', path)
response = con.getresponse()
contents = response.read()
con.close()
return response.status, contents
def post(host, path, data, port = 80):
con = httplib.HTTPConnection(host, port)
con.request('POST', path, data)
response = con.getresponse()
contents = response.read()
con.close()
return response.status, contents
def put(host, path, data, port = 80):
con = httplib.HTTPConnection(host, port)
con.request('PUT', path, data)
response = con.getresponse()
contents = response.read()
con.close()
return response.status, contents
def delete(host, path, port = 80):
con = httplib.HTTPConnection(host, port)
con.request('DELETE', path)
response = con.getresponse()
contents = response.read()
con.close()
return response.status, contents
def options(host, path, port = 80):
con = httplib.HTTPConnection(host, port)
con.request('OPTIONS', path)
response = con.getresponse()
contents = response.read()
con.close()
return response.status, contents
Jump to Line
Something went wrong with that request. Please try again.