feedback_customer_query.py
3.08 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*- coding: utf-8 -*-
"""
@Time : 2021/8/3 9:11
@Auth : wlm
@File :test_feedback_customer_query.py
@IDE :PyCharm
"""
from commons import common as com
from commons.MySession import my,sy1
class feedback_customer_query():
url = "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list.action"
header = {
"Host": "test.jmsf.diligrp.com:8385",
"Connection": "keep-alive",
"Content-Length": "0",
"Accept": "application/json,text/javascript,*/*;q=0.01", "Origin": "http://test.jmsf.diligrp.com:8385",
"X-Requested-With": "XMLHttpRequest",
"User-Agent": "Mozilla/5.0(WindowsNT6.2;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/84.0.4147.105Safari/537.36",
"Accept-Language": "zh-CN,zh;q=0.9",
"Referer": "http://test.jmsf.diligrp.com:8385/FeedbackCustomerController/list",
"Accept-Encoding": "gzip,deflate",
"Content-Type": "application/x-www-form-urlencoded",
}
body = '''rows=10&page=1&sort=id&order=desc&metadata[created]=[provider=datetimeProvider&index=10&field=created]
&metadata[status]=[provider=stateProvider&index=20&field=status]
&metadata[created] = {"provider": "datetimeProvider", "index": 10, "field": "created"}
&metadata[status] = {"provider": "stateProvider", "index": 20, "field": "status"}
&name=史芳&reatedStart=2021-08-02 00:00:00&createdEnd=2021-08-03 23:59:59'''
# body = "rows=10&page=1&sort=id&order=desc&\
# metadata[created]=[provider=datetimeProvider&index=10&field=created]\
# &metadata[status]=[provider=stateProvider&index=20&field=status]\
# &name=史芳&reatedStart=2021-08-02 00:00:00&createdEnd=2021-08-03 23:59:59"
# body = {
# "rows":"10",
# "page":"1",
# "sort":"id",
# "order":"desc",
# "metadata[created]": {"provider": "datetimeProvider", "index": 10, "field": "created"},
# "metadata[status]": {"provider": "stateProvider", "index": 20, "field": "status"},
# "name": "史芳",
# "createdStart":"2021-08-02 00:00:00",
# "createdEnd":"2021-08-03 23:59:59",
# }
# body = dict(body)
# body["metadata[created]"] = json.dumps(body["metadata[created]"])
# body["metadata[status]"] = json.dumps(body["metadata[status]"])
# "metadata[created]": {"provider": "datetimeProvider", "index": 10, "field": "created"},
# "metadata[status]": {"provider": "stateProvider", "index": 20, "field": "status"},
# body = json.dumps(body).encode('utf-8')
def __init__(self):
self.url = feedback_customer_query.url.replace("http://test.", com.get_global_config("global_data", "environment", "en"))
self.header = feedback_customer_query.header
self.body = feedback_customer_query.body
# print(self.body)
# feedback_customer_query = urllib.parse.urlencode(feedback_customer_query())
# fcq = feedback_customer_query
# print(fcq.body)
# re = sy1.post(url = fcq.url, data = fcq.body.encode('utf-8'),headers = fcq.header,proxies=my.myproxies)
# print(re.text)