2

How do I write the following APIGEE related curl command in Java

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" \
https://{org-name}-test.apigee.net/oauth/client_credential/accesstoken? 
grant_type=client_credentials \
-d 'client_id={consumer-key}&client_secret={consumer-secret}'

Using curl is not allowed in our company so want to execute the command from Java. Any help would be appreciated.

Note - To some extent this URL was helpful How do i do the following curl command in Java

San4musa
  • 277
  • 2
  • 12
  • Welcome to Stackoverflow. Please post what you have tried and what you are thinking for your solution? Otherwise this question is too broad to be answered. To understand what makes a good question, please read https://stackoverflow.com/help/how-to-ask. – Stephen M -on strike- Dec 11 '18 at 16:22
  • I tried the solution provided by the link "How do i do the following curl command in Java" but I could not go forward because of some the parameter used in the command for which I need help. – San4musa Dec 14 '18 at 05:18
  • What error did you get from that solution? – Stephen M -on strike- Dec 14 '18 at 15:02
  • Actually I'm not getting any error the problem is that I'm not able to map the command in Java code like other parameter so that I can run the program. Thanks for your response. – San4musa Dec 19 '18 at 04:39

0 Answers0