I would like to redirect user’s POST request with form data using 307 redirect like that
protected void RedirectTemporary(string url)
{
Response.ClearContent();
Response.StatusCode = 307;
Response.StatusDescription = "Temporary Redirect";
Response.RedirectLocation = ResolveClientUrl(url);
Response.Flush();
}
But is it possible to change some form-data fields before sending the redirect response back to user?
Request["someField"] is readonly, and Response seems not to have any writable data collection either.
I will answer myself – no, its impossible, cause redirect 307 returns no form fields and simply tells browser to just repeat it’s request to new location. The get out is to use
WebRequestwith newNameValueCollection, copied from the clients request.