ARTICLE AD BOX
We have a legacy EDI HTTP POST upload to a third party supplier which requires headers in this format:
--BOUNDARY
Content-type: application/x-ups-binary
Content-length:
.Net HttpClient generates headers with Content-Type and Content-Length (upper case Type and Length) but in .Net Framework we are able to work around that by using code like this:
var content = new StringContent(data.Content + "\r\n"); content.Headers.Remove("Content-Type"); content.Headers.TryAddWithoutValidation("Content-type", "application/x-ups-binary"); content.Headers.Remove("Content-Length"); content.Headers.TryAddWithoutValidation("Content-length", data.Content.Length.ToString()); form.Add(content);However in .Net 10 that code executes but the headers get corrected to Content-Type and Content-Length. Is there an alternative approach please that will work with .Net 10?
