本文共 390 字,大约阅读时间需要 1 分钟。
基于Jenkins接口测试
1 2 3 4 5 6 7 8 9 10 11 | # 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() #读出返回信息 |