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
import json
import pytest
import requests
url = "http://10.2.20.41:8099/tkio2/openapi/v1/channel_callback/"
cookie = 'ry-token=InTqr6Hwz1u6MGZl1WpdL6cR8KgL3sfj'
headers = {
'Content-Type': 'application/json',
'Cookie': cookie
}
def test_add():
data = {
"appkey": "678ca51be65b91dfdd86293af9cfbe31",
"cid": 17797,
"callback_name": "腾讯广告-install",
"callback_template": "install",
"event_name": "install",
"attribution_type": "ua",
"touchpoint_type": "click"
}
send_request('add', data)
def send_request(sub_url, data):
response = requests.request("POST", url + sub_url, headers=headers, data=json.dumps(data))
print(response.text)
if __name__ == '__main__':
pytest.main()