Is there any way to do an internal POST with IIS7/ASP.NET MVC?
Basically what I want to do is, stop processing the current request, make an internal POST request with a new body and hand over the response stream to that new request. This is required by a custom authentication flow and can't be done simply by redirects. The application built in ASP.NET MVC 4.
I've played around with various options, including HttpServerUtility.TransferRequest
and HttpServerUtility.Execute
, however most of them are not very POST friendly. TransferRequest
comes close but I can't find a way to supply a new body as the FormCollection
is read only. MVC's own Html.Action
works only for GET methods and will not handle the result from the child action properly (i.e. redirects).
Any other ideas?