def _wrapper(*args, **kargs): print(args[0]) enStr = dargs[0] + aes_tool.encrypy(args[0]).decode('utf-8') print(aes_tool.encrypy(args[0]).decode('utf-8')) print(enStr) args = (enStr, ) return func(*args, **kargs)
def wrapper(*args, **kwargs): print(args[0]) enStr = 'http://1.85.3.154:13003/phpatient/app/appservice?querystr=' + aes_tool.encrypy( args[0]).decode('utf-8') print(aes_tool.encrypy(args[0]).decode('utf-8')) print(enStr) args = (enStr, ) return func(*args, **kwargs)
def startTest(self,endUrl): for i in range(1000): enStr = 'http://app.gsfybjy.com/phpatient/app/appservice?querystr=' + aes_tool.encrypy(endUrl).decode( 'utf-8') self.url_list.append(gevent.spawn(self.requestUrl, enStr)) myLogger.info(enStr) gevent.joinall(self.url_list)
def reqServer(url): tmpUrl = 'http://app.gsfybjy.com/phpatient/app/appservice?querystr=' enStr = aes_tool.encrypy( '/app/phpatientmain/login?aUserName=17737166928&aPassword=E10ADC3949BA59ABBE56E057F20F883E&aVersionNo=1.2.625&aClientType=0' ) print("{}{}".format(tmpUrl, enStr)) # 开始请求 response = requests.get("{}{}".format(tmpUrl, enStr)) try: if response.status_code == 200: print(response.text) print('success') except Exception as e: print(e) print(response.text)
from gevent import monkey monkey.patch_all() import gevent, requests import time from aes_tool import aes_tool from logger import Logger myLogger = Logger(logger="request").getlog() def f(url): data = requests.get(url) if data.status_code == 200: myLogger.info("success") start = time.time() url_list = [] endUrl = '/app/phpatientarticle/appuseagreement?aArticleCategoryId=47DE670DABEA41838356283C6E212435' for i in range(1000): enStr = 'http://app.gsfybjy.com/phpatient/app/appservice?querystr=' + aes_tool.encrypy( endUrl).decode('utf-8') url_list.append(gevent.spawn(f, enStr)) myLogger.info(enStr) gevent.joinall(url_list) myLogger.info(time.time() - start) myLogger.info('---------end----------')
def wrapper(*args,**kwargs): enStr = 'http://app.gsfybjy.com/phpatient/app/appservice?querystr='+ aes_tool.encrypy(args[0]).decode('utf-8') args = (enStr,) return func(*args,**kwargs)
def wrapper(*args,**kwargs): print(args) enStr = aes_tool.encrypy(args[2]).decode('utf-8') args = (args[0],args[1],enStr,args[3]) return func(*args,**kwargs)