title: Invoking curl commands from Java
body: <pre><code>curl -k -XPOST 'https://localhost:9200/myweb/myrep/**input_string**/_update'  -d '{"doc":{"status":"Disconnected"}}'
  </code></pre>
  
  <p>Invoke above for a list of <strong>input_string</strong> from a XML file</p>
  
  <p>Option 1: 
  Write a bash script to accomplish above and then call this script from Java code</p>
  
  <p>Option 2:
      RunTime.exec() to call curl command in a for loop
  like this : <a href="https://stackoverflow.com/questions/31049555/curl-command-in-java">curl command in java</a></p>
  
  <p>Is there any other better way?</p>
  
  <p>This will be one of the important steps in my overall Java program which is doing various other things. That's the reason I am looking for ways to integrate this well with Java code rather than providing an option to run above as separate CLI script.</p>