2

How to use the cURl command

curl https://na1.salesforce.com/services/data/v20.0/query?q=SELECT+name+from+Account -H "Authorization: Bearer access_token" -H "X-PrettyPrint:1"

in java to call sales force rest web services

3 Answers 3

2

Java has an URLConnection Class that has similar functions as cURL.

Sign up to request clarification or add additional context in comments.

Comments

0

For interacting with the salesforce API, it is best to use a client library and not implement it all by yourself, see http://blog.palominolabs.com/2011/03/03/a-new-java-salesforce-api-library/ for an example.

Comments

0

Easiest way is to download cURL java wrapper like https://github.com/pjlegato/curl-java and use cURL directly in your code.

Second way is to use Runtime.getRuntime().exec("crul...") "pattern" and run curl as a normal process.

Comments

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.