I have a Web API action that accepts large (100 MB+) files and forwards them to another HTTP service. I want to stream the request body to the other service, to prevent having to wait for the entire request body to be pulled into memory.
I've found this question, which explains how to prevent Web API from buffering the request body, but I can't figure out how to access the stream from the Request
object in my action.
I've looked at the functions provided by the HttpContent
class, but they all imply that they pull the entire request into memory.
How can I obtain my request stream without pulling the entire body into memory?