# -*- coding: utf-8 -*- # @Author: privacy # @Date: 2022-09-20 13:55:42 # @Last Modified by: privacy # @Last Modified time: 2022-09-27 12:16:19 import time import requests session = requests.Session() HOST = "172.16.57.71" url = "http://{}:8085/user/login".format(HOST) headers = { "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9", "Cache-Control": "no-cache", "ContentType": "application/json;charset=UTF-8", "Origin": "http://{}:8085".format(HOST), "Pragma": "no-cache", "Referer": "http://{}:8085/login.html".format(HOST), "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" } jar = requests.cookies.RequestsCookieJar() jar.set("session", "eyJjc3JmX3Rva2VuIjoiOWE3OGQ1ZDZjZmU3ODJlYTUzM2VjOGYxNzkwMTA5YTg1ZTQ3ODcwNCJ9.Yy101A._XhmCuMea8D5sCM_0CgoTSB0AvI", domain=HOST, path="/") # jar.set("JSESSIONID", "7cfbbf54-cabf-44fc-83db-b84003e6d552", domain="180.76.188.39", path="/") body = { "userName": "wzh", "password": "l639ACZIzamCGIFToBfqw34sJy/8dYpvcsj8W75BGA1avQ1BpM2J2lxUvXS6nnMPH1/KurCLBxj4GcgvyyLydMH2+h3E/mSA3loENoQSeSEpXCyIfcHInN5pSW2c1u1odB5Vsx40aqcWAi4bVnEMdzu+j0V5xGUDRTnh/dDQKGN1YEKyDkSms+WZDEbLUogGbPLV2sCAycx7YTrN0ta8p8u3d/BAXTXY9L3RMeB2M58cRHHdSO6YBdboCVsffLLs1BRY/EW1Q1idM05aEHRT2zaHDfzk1IZ+WUdGjqsHKD4syo9buZZ3qiybhj0tc5LZRSgUYgW0hpg6TXzY1Ko6LA==" } session.post(url, headers=headers, cookies=jar, data=body) time.sleep(2) url = "http://180.76.188.39:8085/kgaasApi/v2/dag/batch/start" headers = { "Accept": "application/json, text/plain, */*", "Accept-Encoding": "gzip, deflate", "Accept-Language": "zh-CN,zh;q=0.9", "Cache-Control": "no-cache", "ContentType": "application/json;charset=UTF-8", "Origin": "http://{}:8085".format(HOST), "Pragma": "no-cache", "Referer": "http://{}:8085/backend-fe/static/".format(HOST) } body = { "inc": 1, "_t": int(time.time() * 1000), "running_mode": 0 } print(session.post(url, headers=headers, cookies=jar, data=body))