I've just spent the past 10 hours trying to figure out why my http request was failing when I did a
request.Content.ReadAsMultipartAsync().Result.Contents
It kept returning the error:
Unexpected end of MIME multipart stream. MIME multipart message is not complete.
After many hours of research, I finally discovered that the request did not have an ending CRLF, which apparently .Net needs to determine the end of the request. When I added my own CRLF, everything worked great.
In WireShark, I looked at one of the requests, I saw that the chunked request did have an ending CRLF, but the De-Chunked request did not.
So that leaves me with 2 questions.
- Why is my request missing the ending CRLF, and
- Is there any way to add it back before it gets to .Net so that .Net will process it correctly?