Reputation: 3600
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
Upvotes: 2
Views: 1635
Reputation: 2874
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.
Upvotes: 0
Reputation: 12869
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.
Upvotes: 0
Reputation: 897
Java has an URLConnection Class
that has similar functions as cURL.
Upvotes: 2