title: What is the java equivalent of the curl command?
body: <p>Can anyone help me to convert the following into java equivalent?</p>
  
  <pre><code>curl -XGET 'localhost:9200/indexname/status/_search?pretty=1&amp;size=10000' -d '{"_source": {"include": [ "ID", "Name" ]}}'
  </code></pre>
  
  <p>I tried to use this:</p>
  
  <pre><code>ProcessBuilder pb = new ProcessBuilder("curl","-g","-H Content-Type: application/json", "-H Accept: application/json", "-XGET","http://localhost:9200/indexname/status/_search?pretty=1&amp;size=10000","-d '{\"_source\": {\"include\": [ \"ID\", \"Name\" ]}}'");
  </code></pre>
  
  <p>On running the java code, it return a Parse failure exception. Any advice? Thanks.</p>