我试图在这里使用身份验证:
https://api.graphnethealth.com/system-auth
使用Python urllib3并具有以下功能
import urllib3
http = urllib3.PoolManager()
resp = http.request(
"POST",
"https://core.syhapp.com/hpca/oauth/token",
headers={
"Content-Type": "application/x-www-form-urlencoded"
},
fields={
"grant_type": "client_credentials",
"client_id": "YYYYYYYYY",
"client_secret": "XXXXXXXXX"
}
)
print(resp.data)
我说这话是错的
grant_type
尚未发送。
b'{\r\n "error": {\r\n "code": "400",\r\n "message": "Validation Errors",\r\n "target": "/oauth/token",\r\n "details": [\r\n {\r\n "message": "grant_type is required",\r\n "target": "GrantType"\r\n },\r\n {\r\n "message": "Value should be one of the following password,refresh_token,trusted_token,handover_token,client_credentials,pin",\r\n "target": "GrantType"\r\n }\r\n ]\r\n }\r\n}'
有什么建议吗?