Converting CURL request to HTTP Request Java by method GET -
i have following curl request can please confirm me 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 kind enough me convert above curl request httpreq.
you should have @ post: using java.net.urlconnection fire , handle http requests
you should able pass data part is:
urlconnection connection = new url(url + "?" + datastring).openconnection();
using:
connection.setrequestproperty("accept: application/json", charset);
to add header
this starting point...
Comments
Post a Comment