I am not getting the response I am wanting for the following code:
var multipart = new MultipartFormDataContent();
var empty = Encoding.ASCII.GetBytes("\r\n\r\n\r\n");
HttpContent content = new ByteArrayContent(empty);
content.Headers.Add("name", "jform[ical_url]");
multipart.Add(content);
...[cut for brevity]...
using (var handler = new HttpClientHandler { UseCookies = false })
using (var client = new HttpClient(handler) { BaseAddress = new System.Uri("http://icalendar.org") })
{
var response = await client.PostAsync("/validator", multipart);
I know exactly what I would like the POST request to look like (having used Firebug's 'copy cURL' menu item).
Is there a way to see what the client.PostAsync will send, or an extension to serialise the multipart variable above so that I can compare with the cURL string from a successful post?
Thank you.