0
curl -d 'user[name]=huck&user[email]=huck@xyz.com''http://sandbox.v2.xyz.com/api/berl/a4be95e6f86/users.json'

can anyone tell me how we will be able to run this curl command.

Another thing if i run it through java what will be the java equivalent to this call? it is basically a call to rest service

Gaurav
  • 21
  • 6
  • 1
    If it is rest call, may be HttpURLConnection API will be helpful.http://digiassn.blogspot.com/2008/10/java-simple-httpurlconnection-example.html – kosa Aug 01 '12 at 13:56
  • Very similar to http://stackoverflow.com/questions/1359689/how-to-send-http-request-in-java -- you want to send an HTTP request and read the response. – ametren Aug 01 '12 at 13:57
  • 1
    Even Better: http://stackoverflow.com/questions/2793150/how-to-use-java-net-urlconnection-to-fire-and-handle-http-requests – ametren Aug 01 '12 at 13:59

1 Answers1

0

You have two choiches:

  1. Using something like HttpClient.

  2. Using something like apache exec

chris
  • 669
  • 9
  • 16