创建百度云应用调用unit的技能或者机器人
Ta的回复 :import json import requests headers = {'Content-Type': 'application/json;charset=UTF-8'} url_access = "https://aip.baidubce.com/oauth/2.0/token" data_access = { "grant_type":"client_credentials", "client_id":"*******", "client_secret":"*********", } req = requests.post(url_access, json.dumps(data_access), headers) result = json.loads(req.text) #access_token=result["access_token"] print(result) 似乎不能请求成功 错误:{'error': 'unsupported_grant_type', 'error_description': 'The authorization grant type is not supported'} 但当我使用示例方法时: request = urllib.request.Request(host) request.add_header('Content-Type', 'application/json; charset=UTF-8') response = urllib.request.urlopen(request) content = response.read() content似乎不是json或者字典