app测试测试员的那点事软件测试

tornado 压力测试

2016-06-12  本文已影响654人  望月成三人
import tornado.ioloop
from tornado.httpclient import AsyncHTTPClient
def handle_request(response):
    if response.error:
        print ("Error:", response.error)
    else:
        print(response.body)
param = {"msg":"111"}
param["img_msg"] = open("t.jpg",'r',encoding='utf-8')
url = 'http://gc.ditu.aliyun.com/geocoding?a=苏州市'
i = 1
print(param)
req = tornado.httpclient.HTTPRequest(url, 'POST', body=str(param))
http_client = AsyncHTTPClient()
while i<10000:
    i += 1
    http_client.fetch(req, handle_request)
tornado.ioloop.IOLoop.instance().start()
上一篇下一篇

猜你喜欢

热点阅读