I have the following code:
private static string boundary = \"----CustomBoundary\" + DateTime.Now.Ticks.ToString(\"x\"); private static async Task
Solved this by removing the header from MultipartFormDataContent and re-adding it back without validation:
content.Headers.Remove("Content-Type"); content.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary);