What is the easiest way to submit an HTTP POST request with a multipart/form-data content type from C#? There has to be a better way than building my own request.
T
The System.Net.WebClient class may be what you are looking for. Check the documentation for WebClient.UploadFile, it should allow you to upload a file to a specified resource via one of the UploadFile overloads. I think this is the method you are looking to use to post the data...
It can be used like.... note this is just sample code not tested...
WebClient webClient = new WebClient();
webClient.UploadFile("http://www.url.com/ReceiveUploadedFile.aspx", "POST", @"c:\myfile.txt");
Here is the MSDN reference if you are interested.
http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadfile.aspx
Hope this helps.