is response.redirect always an http GET response? or it could be POST?....
相关问题
- Angular RxJS mergeMap types
- Carriage Return (ASCII chr 13) is missing from tex
- How to store image outside of the website's ro
- 'System.Threading.ThreadAbortException' in
- Stop .htaccess redirect with query string
Response.redirect uses only GET..It can't be a post..And in between what is the language?
In most API's the standard redirect implementation does a 302 which is indeed per definition GET. As per your question history you're familiar with ASP.NET, I'll however add examples for Java Servlets as well.
ASP.NET:
Servlet:
It implicitly sets the response status to 302 and the
Location
header to the given URL.When the current request is a POST request and you want to redirect with POST, then you need a 307 redirect. This is not provided by the standard API, but it's usually just a matter of setting the appropriate response status and header.
ASP.NET:
Servlet:
Note that this will issue a security/confirmation warning on the average client which requests the enduser for confirmation to send the POST data to another location.
Assuming that you are using asp.net, maybe server.transfer might be what you are searching for. Instead of sending the new url back to the client, you can pass the processing to another page and keep the form state.
A redirect is an Http response sent to the client. The response contains an Http Header called Location which must contain an absolute url.
The client then issues a GET request against this url.
So, no, POST is not an option.
More details here: http://en.wikipedia.org/wiki/URL_redirection
Contrary to most answers here the redirected HTTP request is only GET if