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

4
  • 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 stackoverflow.com/help/how-to-ask. Commented Dec 11, 2018 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. Commented Dec 14, 2018 at 5:18
  • What error did you get from that solution? Commented Dec 14, 2018 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. Commented Dec 19, 2018 at 4:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.