Support binding request body as Stream in Controller Actions #41540
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
feature-model-binding
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
The #38153 introduced the support for binding
Stream
/PipeReader
, since it is common pattern a similar support must be available in Controller Actions.Describe the solution you'd like
I would like to replicate the same code I have for a Minimal APIs:
I my Controller Actions:
I should also be able to explicitly define the parameter
[FromBody] Stream body
and must have the same behavior.Additional context
The same considerations applied to Minimal should be applied here as well:
Stream
will be the same object asHttpRequest.Body
.Stream
/PipeReader
are not usable outside of the controller action handler as the underlying buffers will be disposed and/or reused.The text was updated successfully, but these errors were encountered: