大神问下 获取assacctoken出错
String authHost = "https://aip.baidubce.com/oauth/2.0/token?";
String getAccessTokenUrl = authHost
// 1. grant_type为固定参数
+ "grant_type=client_credentials"
// 2. 官网获取的 API Key
+ "&client_id=" + "SUGktFzGCA2wwcbfO5xWDySL"
// 3. 官网获取的 Secret Key
+ "&client_secret=" + "u5g7LPFltdXXyHusC7RbrDy6I6PPV9YS";
为什么我用官网上的代码基本没改只填充了key 运行会出现java.net.MalformedURLException: Illegal character in URL
at sun.net.www.protocol.https.HttpsURLConnectionImpl.checkURL(HttpsURLConnectionImpl.java:86)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.(HttpsURLConnectionImpl.java:94)
包是官网的最新的
Postman提交https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=SUGktFzGCA2wwcbfO5xWDySL&client_secret=u5g7LPFltdXXyHusC7RbrDy6I6PPV9YS
却成功返回assecc token