upStream.py
1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import requests
import json
import urllib3
from commons import common as com
from commons.MySession import my,s1,s3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class upStream():
url="http://test.trace.diligrp.com:8393/upStream/listPage.action"
header={
"Host": "test.trace.diligrp.com",
"Connection": "keep-alive",
"Content-Length": "325",
"Accept": "application/json,text/javascript,*/*;q=0.01",
"X-Requested-With": "XMLHttpRequest",
"User-Agent": "Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/90.0.4430.212Safari/537.36",
"Content-Type": "application/json",
"Origin": "http://test.trace.diligrp.com:8393",
"Referer": "http://test.trace.diligrp.com:8393/upStream/index.html",
"Accept-Encoding": "gzip,deflate",
"Accept-Language": "zh-CN,zh-TW;q=0.9,zh;q=0.8,en;q=0.7"}
body={"rows":10,"page":1,"sort":"id","order":"desc","metadata":{"created":"{\"provider\":\"datetimeProvider\",\"index\":10,\"field\":\"created\"}","upORdown":"{\"provider\":\"userFlagProvider\",\"index\":20,\"field\":\"upORdown\"}","upstreamType":"{\"provider\":\"upStreamTypeProvider\",\"index\":30,\"field\":\"upstreamType\"}"}}
def __init__(self):
self.url=upStream.url.replace("http://test.",com.get_global_config("global_data", "environment", "en") )
self.header=upStream.header
self.body=upStream.body
# uu=upStream()
# re=my.post(url=uu.url,headers=uu.header,json=uu.body)
# print(re.json())
#=========================================================
# body=uu.body.copy()
# body["likeName"]="111"
# re=my.post(url=uu.url,headers=uu.header,json=body)
# print(re.json())