我认为问题出在访问 protected 资源的配置设置中,但我在这里可能是错的。 我已经尝试过使用 SalesForce 和 Gmail..
这是我尝试用于 gmail 的示例配置文件
#scope=
grant_type=password
username=chitXXXXal@gmail.com
password=sumXXX3
client_id=685531072783-qu8rcpnv05800u1i3g8g3302eap1u914.apps.googleusercontent.com
#client_secret=
#access_token=
#refresh_token=
authentication_server_url=https://mail.google.com
resource_server_url=https://mail.google.com
我对 Oauth 非常陌生,因此我无法理解如何获取 JSON 响应。 我收到以下回复
“文本/html;字符集=UTF-8”
这给了我以下错误..
"Cannot handle text/html; charset=UTF-8 content type. Supported content types include JSON, XML and URLEncoded"
提前致谢。
最佳答案
您需要发送请求 header 接受:application/json
关于java - 在java中没有得到JSON响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42106732/