channelcallback.py 774 Bytes
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()