I'm getting a Multipart MIME response from an HTTP call and need to extract the parts. I'm looking for a simple way to do this.
I'm using the System.Net.Http methods to get the content, however extracting the response parts is confusing me.
HttpClient zClient = new HttpClient();
Uri zAddress = new Uri("http://someDomain.com");
HttpContent content = new StringContent(sb.ToString());
HttpResponseMessage response = zClient.PostAsync(zAddress, content).Result;
if (response.IsSuccessStatusCode)
{
// This returns true
bool zIsMime = response.Content.IsMimeMultipartContent();
// How do I get the message parts here. This ReadAsMultipartAsync method is confusing me.
ReadAsMultipartAsync(HttpContent) ????
}
else
{
Console.WriteLine("{0} ({1})", (int)response.StatusCode, response.ReasonPhrase);
}