title: Curl Is Not Recognized , Using Popen()
body: <pre><code>p = Popen(["curl", "http://localhost:8983/solr/update/json?commit=true", "--data-binary", "@solrData.json", "-H", "Content-type:application/json"], cwd=r"C:/Users/SOLR/docs", shell=True)
  </code></pre>
  
  <p>This the code I am using right now, and I get the error that curl is not recognized.
  When I run the command in the same dir where the solrData.json file is:</p>
  
  <pre><code>curl "http://localhost:8983/solr/update/json?commit=true" --data-binary @solrData.json -H "Content-type:application/json"
  </code></pre>
  
  <p>it runs perfectly. Curl is in the system path and there everthing works.
  Also as a comparison this works just fine:</p>
  
  <pre><code>p = Popen("java -jar post.jar solrData.xml", cwd=r"C:/Users/SOLR/docs")
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>    import requests
  # open the file to upload
          with open('C:/Users/SOLR/docs/solrData.json', 'rb') as fin:
              # execute the post request
              headers = {'Content-type': 'application/json'}
              r = requests.post("http://localhost:8983/solr/update/json", params=dict(commit="true"), headers=headers, data=fin.read())
  </code></pre>
  
  <p>This is the solution that works. Thank you zmo and Martijn Pieters for your help.</p>