header = {'Content-type': 'application/json','Authorization': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' }
url = 'https://sandbox-authservice.priaid.ch/login'
response = requests.post(url, headers = header, verify=False).json()
token = json.dumps(response)
print token['ValidThrough']
我想在我的 webhook 中打印 ValidThrough 属性,该属性通过 POST 调用作为 JSON 数据接收。我知道这已经被问过很多次了,但是 print token['ValidThrough'] 对我不起作用。我收到错误“TypeError:字符串索引必须是整数,而不是 str”