如何使用 python 将元数据添加到 woocommerce 订单?

问题描述 投票:0回答:0

这是给我带来问题的代码:

url = 'https://xxxxxxxxx' # correct website is in code
datos = {"meta_data": {"id":8888}, {"key":"Serial_number"}, {"value":self.variable}}
datos_json = json.dumps(datos)
headers2 = {'Authorization': 'Basic xxxxxxxxxxxxx'} #correct key is in code

response = requests.request('POST', url = url, headers = headers2, data = datos_json)

我得到错误:

SyntaxError: ':' expected after dictionary key

我尝试了“datos”的所有语法组合

python woocommerce metadata orders
© www.soinside.com 2019 - 2024. All rights reserved.