I need to schedule a Windows task that will invoke Solr DataImportHandler command. So I decided to create a console app which will invoke the DataImportHandler command using WebClient. However, this simple code does not seem to work for me. The uri works independently but not from the console app. What am I doing wrong? Please help. (I have tried DownloadString as well).
using (WebClient client = new WebClient())
{
var uri = "http://localhost:8983/solr/#/collection1/dataimport//dataimport?command=full-import&clean=true&commit=true";
client.OpenRead(uri);
}