-1

I have the following CURL request Can anyone please confirm me what would be the subsequent HTTP Request:

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"

Can anyone be kind enough to help me convert the above curl request completely to httpreq.

tinlyx
  • 18,900
  • 26
  • 81
  • 148

1 Answers1

0

you should have a look at this post: Using java.net.URLConnection to fire and handle HTTP requests

You should be able to pass the data part as is:

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

using:

connection.setRequestProperty("Accept: application/json", charset);

to add the header

This is a starting point...

Community
  • 1
  • 1
Eric T.
  • 66
  • 5