import json

import base64

from config import base_path

print(base_path)


def encode_payload(payload):
    payload['data'] = base64.b64encode(json.dumps(payload['data']).encode('utf-8')).decode('utf-8')
    return json.dumps(payload)


payload = {'data': {"cmd": "enable", "name": "wpsPlugin", "url": "http://172.10.3.110:3000/", "addonType": "wps",
                    "online": "true"},
           'serverId': '524ef80e-7ccd-43af-9fcb-69f3b0269730'}

payload['data'] = base64.b64encode(json.dumps(payload['data']).encode('utf-8')).decode('utf-8')

print(payload)
