I have seen How do I replace curl invoke with HttpClient object invoke or some similar? but it didn't answer my question. I have been given the below cURL command by our vendor, with some optional parameters, and instructions to use a CRON job to run it. It seems it would be more efficient to send the CSV my C# code is generating via HttpClient rather than dropping the CSV somewhere and going through the CRON job business. The C# I am writing will be part of an automation service we already have in place.
Here is the cURL:
curl -F "passkey=<PASS KEY>" -F "uploadFile=@<PATH_TO_YOUR_CSV_FILE>" https://td-setup.xxxxxx.com/<DOMAIN NAME>/csvupload
There is a loadAll parameter that I will want to use.
I have added Microsoft.Net.Http -Version 2.2.22 to my project via NuGet, and now find myself not sure what to do next. Sadly, this is all the further I've gotten:
string baseAddress = String.Format("{0}/{1}/{2}", taskConfig.Upload.BaseUrl, domain.Username, taskConfig.Upload.UploadLocation);
using (HttpClient client = new HttpClient)
{
}
I typically like to have demonstrated more of an effort before asking her help, but I'm over my head. How do I begin? Add the passkey? the loadAll parameter?