python接口测试(一)
基于jenkins接口测试
# coding = utf-8
import Httplib
http_client = None
http_client = httplib.HTTPConnection('localhost' , 8080 , timeout=30)
http_client.request('GET' , '/jenkins/api/JSON')
response = http_client.getresponse()
print response.status #返回状态码
print response.read() #读出返回信息
相关文章