通过GET方法将CURL请求转换为HTTP请求Java

通过GET方法将CURL请求转换为HTTP请求Java,java,curl,get,Java,Curl,Get,我有以下CURL请求,请任何人确认我接下来的HTTP请求是什么: curl -i -L -H "Accept: application/json" --data "client_id=APP-UJA2FDFLIVK14WMW&client_secret=6d8d32f1-1c25-4356-8b15-4d803d9a869e&grant_type=authorization_code&code=dj4kYk&redirect_uri=https://develop

我有以下CURL请求,请任何人确认我接下来的HTTP请求是什么:

curl -i -L -H "Accept: application/json" --data "client_id=APP-UJA2FDFLIVK14WMW&client_secret=6d8d32f1-1c25-4356-8b15-4d803d9a869e&grant_type=authorization_code&code=dj4kYk&redirect_uri=https://developers.google.com/oauthplayground" "https://api.sandbox.orcid.org/oauth/token"

有人能帮我把上面的curl请求完全转换成httpreq吗?

你应该看看这篇文章:

您应该能够按原样传递数据部分:

URLConnection connection = new URL(url + "?" + dataString).openConnection();
使用:

connection.setRequestProperty("Accept: application/json", charset);
添加标题的步骤


这是一个起点…

你应该先尝试一下,如果你被卡住了,就发布你的问题。